/** * Displays a particular model. * @param integer $id the ID of the model to be displayed */ public function actionView($id) { //find the group $this->layout = '//layouts/group'; $group = Group::model()->findByPk($id); $this->group = $group; //find all groupProduct that belong to that group $model = new GroupProduct('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['GroupProduct'])) { $model->attributes = $_GET['GroupProduct']; } $this->render('view', array('model' => $model, 'group' => $group)); }
public function actionEventGroupProduct($id) { $this->layout = '//layouts/eventDetail'; $this->eventDetail_model = Event::model()->with(array('GroupProductsCount', 'JoinedGroups'))->findByPk($id); if ($this->eventDetail_model == null) { throw new CHttpException(404, 'The specified Event cannot be found.'); } $model = new GroupProduct('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['GroupProduct'])) { $model->attributes = $_GET['GroupProduct']; } $this->render('eventGroupProduct', array('dataprovider' => $model->getOnlyEventData($id))); }
public function actionFollowingGroup() { $user = User::model()->findByPk(Yii::app()->user->id); if ($user == null) { throw new CHttpException(404, 'The specified user cannot be found.'); } $model = new GroupProduct('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['GroupProduct'])) { $model->attributes = $_GET['GroupProduct']; } $this->render('followingGroup', array('model' => $model, 'user' => $user)); }
/** * Manages all models. */ public function actionAdmin() { $this->layout = '//layouts/admin'; $model = new GroupProduct('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['GroupProduct'])) { $model->attributes = $_GET['GroupProduct']; } $this->render('admin', array('model' => $model)); }