Commit 8402cafa by Alexander Makarov

Corrected redirect in example, used request for getting post instead of global

parent cdb1221a
......@@ -164,9 +164,9 @@ class BlogController extends Controller
}
if (\Yii::$app->request->isPost) {
$post->load($_POST);
$post->load(Yii::$app->request->post());
if ($post->save()) {
$this->redirect(['view', 'id' => $post->id]);
return $this->redirect(['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