<body >
<div class="header">
头部
</div>
<div class="main">
<div class="sidebar">
侧边栏
</div>
<div class="content">
主要内容区域
</div>
</div>
<div class="footer">
底部
</div>
</body>
</html>
<div class="header">
头部
</div>
<div class="main">
<div class="sidebar">
侧边栏
</div>
<div class="content">
主要内容区域
</div>
</div>
<div class="footer">
底部
</div>
</body>
</html>
2017-01-14
第9个评论
@foreach ($pages as $page)
<li >
<div class="title">
<a href="{{ URL('pages/'.$page->id) }}">
<h4>{{ $page->title }}</h4>
</a>
</div>
<div class="body">
<p>{{ $page->body }}</p>
</div>
</li>
@endforeach
@foreach ($pages as $page)
<li >
<div class="title">
<a href="{{ URL('pages/'.$page->id) }}">
<h4>{{ $page->title }}</h4>
</a>
</div>
<div class="body">
<p>{{ $page->body }}</p>
</div>
</li>
@endforeach
和Yii2太像了,这也算节约学习成本嘛
$role = new Role();
$role->id = Common::generateID();
$role->name = Yii::$app->request->post('name');
$role->state = '1';
if($role->save()){
return "success";
}else{
return "fail";
}
$role = new Role();
$role->id = Common::generateID();
$role->name = Yii::$app->request->post('name');
$role->state = '1';
if($role->save()){
return "success";
}else{
return "fail";
}
2017-01-10
可以看看Yii2的ActiveRecord,
$dictItem = Dictitem::find()
->where(['dictCode' => 'DICT_STATE'])
->all();
$role =Role::findOne($id);
$dictItem = Dictitem::find()
->where(['dictCode' => 'DICT_STATE'])
->all();
$role =Role::findOne($id);
2017-01-10