Commit 279b274e by Alexander Makarov

fixed controller example

parent 0aa71986
......@@ -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));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment