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(); $this->redirect('/admin/pages'); }