const IS_VALID = '1';//默认是已经发布
const NO_VALID = '0';//未发布
该处必须是字符串类型的,或者在posts下面的rule对is_valid的验证去掉,不然会添加不上去
const NO_VALID = '0';//未发布
该处必须是字符串类型的,或者在posts下面的rule对is_valid的验证去掉,不然会添加不上去
2018-05-01
main.php中Breadcrumbs改'url' => Url::to(['site/index']),
2018-04-21
<p><a href="<?=Url::to('../post/create')?>" class="btn btn-success" style="width:100%;color:#fff;">创建文章</a></p>
<p><a href="<?=Url::to('../post/update')?>" class="btn btn-info" style="width:100%;color:#fff;">创建文章</a></p>
<p><a href="<?=Url::to('../post/update')?>" class="btn btn-info" style="width:100%;color:#fff;">创建文章</a></p>
2018-04-21
$postModel = new PostForm();
//文章统计
$postExtendsModel = new PostExtends();
$postExtendsModel -> upCounter(['post_id'=>$id], 'browser', 1);
$data = $postModel -> getViewById($id);
//文章统计
$postExtendsModel = new PostExtends();
$postExtendsModel -> upCounter(['post_id'=>$id], 'browser', 1);
$data = $postModel -> getViewById($id);
2018-04-21
<?=Url::to(['post/view','id'=>$list['id']])?>
2018-04-21
frontend\config\[arams.php添加'upload_url' => 'http://localhost/',然后调整样式
2018-04-21
'<img src="./imgs/header.png" alt="'. Yii::$app->user->identity->username .'"/>'
2018-04-16
给静态页报错Undefined index:upload_url的大家提个醒:在common/config/params.php里面添加upload_url 直接赋值为空字符串,这样不受域名影响
2018-04-11
Missing argument 3 for yii\db\Command::batchInsert()的,我遇到的情况是因为方括号加错位置了,所以可能要仔细检查一下,先避免打字错误造成的bug
2018-04-02