fixed controller example

This commit is contained in:
Alexander Makarov
2013-07-04 03:22:47 +04:00
parent 0aa71986a3
commit 279b274e5a

View File

@ -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));
}