不好意思啊,前面那条没好好听课,$cookies = \YII::$app->response->cookies;用来设置或者修改cookie。$cookies = \Yii::$app->request->cookies;读取用这个。
2018-03-04
$cookies = \Yii::$app->request->cookies;$cookies = \YII::$app->response->cookies;前者用$cookies->getValue('user');可以获取到已存在的cookie值,而后者不行,啥原因啊,求大神看看
2018-03-04
控制器也好模型也罢 都是一个类文件,在控制器中引入模型层Test以后,Test::find()....的这种操作无非是把模型的逻辑放在控制器中,这个你可以放在模型中完成再到控制器中调用,学东西要学到精髓
2018-01-20
public function actionViews()
{
$data['hello'] = '"how do you chinese food? very much,chinese food is awesome."';
return $this->renderPartial('views',$data);
}
{
$data['hello'] = '"how do you chinese food? very much,chinese food is awesome."';
return $this->renderPartial('views',$data);
}
2018-01-05