|
|
@ -119,9 +119,8 @@ class BlogController extends Controller |
|
|
|
throw new HttpException(404); |
|
|
|
throw new HttpException(404); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$data = \Yii::$app->request->getPost('Post'); |
|
|
|
if(\Yii::$app->request->isPost)) { |
|
|
|
if($data) { |
|
|
|
$post->load($_POST); |
|
|
|
$post->populate($data); |
|
|
|
|
|
|
|
if($post->save()) { |
|
|
|
if($post->save()) { |
|
|
|
$this->redirect(array('view', 'id' => $post->id)); |
|
|
|
$this->redirect(array('view', 'id' => $post->id)); |
|
|
|
} |
|
|
|
} |
|
|
|