mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
fixed controller example
This commit is contained in:
@ -119,9 +119,8 @@ class BlogController extends Controller
|
||||
throw new HttpException(404);
|
||||
}
|
||||
|
||||
$data = \Yii::$app->request->getPost('Post');
|
||||
if($data) {
|
||||
$post->populate($data);
|
||||
if(\Yii::$app->request->isPost)) {
|
||||
$post->load($_POST);
|
||||
if($post->save()) {
|
||||
$this->redirect(array('view', 'id' => $post->id));
|
||||
}
|
||||
|
Reference in New Issue
Block a user