public function actionSave() { if (!empty($this->app->request->post->id)) { $item = Page::findByPK($this->app->request->post->id); } else { $item = new Page(); } $item->fill($this->app->request->post); $item->save(); $item = Page::findByQuery('SELECT * FROM rubric_pages WHERE __id= LAST_INSERT_ID() '); $this->redirect('/admin/Rubrics/Edit?id=' . $item->Pk . '&rubric=' . $item->__rubric_id); }