diff --git a/docs/guide/controller.md b/docs/guide/controller.md index 60ba680..c550b42 100644 --- a/docs/guide/controller.md +++ b/docs/guide/controller.md @@ -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)); }