是否可以对单独的模型进行一次"交易".我想插入带有标签的帖子.标签和帖子分为两个独立的模型.我如何通过交易来处理它?(如下:)
$this->db->trans_start();
$this->post_model->insert('...');
$this->tags_model->insert('...');
$this->db->trans_complete();
Run Code Online (Sandbox Code Playgroud) 如果我现在开始使用CI的项目有什么缺点?在不久的将来(1 - 2年)会出现什么样的问题?我不是实时跟踪CI开发,但也许它不会变得新鲜.我已经在CI编写了多年,我知道并喜欢它.我有一些新的项目,我将用CI开发.我打算稍后转向像laravel这样的新框架,但目前我没有时间学习新的东西并用于实时项目.
我是laravel的新手,我希望按用户ID获取用户的单个记录并在输入值中显示.请指导我
public function profile(){
$userdata = User::all();
return view('pages/edit-profile')->with('userdata',$userdata);
}
Run Code Online (Sandbox Code Playgroud)
Route::get('profile', 'PageController@profile_c');
Run Code Online (Sandbox Code Playgroud)
<form class="form-horizontal" role="form" action="/edit_profile" method="post">
{{ csrf_field() }}
<div class="form-group">
<label class="col-lg-3 control-label">First name:</label>
<div class="col-lg-8">
<input class="form-control" name="firstName" id="firstName" type="text" value="Jane">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Last name:</label>
<div class="col-lg-8">
<input class="form-control" name="lastName" id="lastName" type="text" value="Bishop">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Display name:</label>
<div class="col-lg-8">
<input class="form-control" name="displayName" id="displayName" type="text" value="Jane Bishop">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Email:</label>
<div …Run Code Online (Sandbox Code Playgroud)