public function actionTopicSave() { if (!empty($this->app->request->post->id)) { $item = Topic::findByPK($this->app->request->post->id); } else { $item = new Topic(); } $item->fill($this->app->request->post); $item->save(); $this->redirect('/admin/news/topics/'); }