/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionUp($id = null) { if ($id == null) { $this->redirect(array('site/index')); } else { $model = new AlbumLikes(); $model->album_id = $id; if ($model->save()) { $this->redirect(array('site/view', 'id' => $model->album_id, 't' => Utility::getUrlTitle($model->album->title))); } } }