Код: Выделить всё
public function actionCreate() {
$model=new Post;
if(isset($_POST['Post']))
{
$model->attributes=$_POST['Post'];
if($model->save())
$this->redirect(array('view','id_post'=>$model->id_post));
}
$this->render('create', array('model'=>$model));
}