public $userID; public function init() { parent::init(); $this->userID = Yii::app()->user->id; } public function actionIndex() { $this->pageTitle = 'Companys Listing' . ' - ' . Yii::app()->params['title']; $model = new Listing();
/** * Manages all models. */ public function actionAdmin() { $model = new Listing('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Listing'])) { $model->attributes = $_GET['Listing']; } $this->render('admin', array('model' => $model)); }
/** * Manages all models. */ public function actionIndex() { try { $model = new Listing('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Listing'])) { $model->attributes = $_GET['Listing']; } $this->render('index', array('model' => $model, 'actions' => $this->listActionsCanAccess)); } catch (Exception $e) { Yii::log("Exception " . print_r($e, true), 'error'); throw new CHttpException("Exception " . print_r($e, true)); } }