function beginRequest($event) { $app = Yii::app(); $app->name = Vars::model()->find("varname='SITE_NAME'")->varvalue; $app->params['adminEmail'] = Vars::model()->find("varname='adminEmail'")->varvalue; $app->params['footerinfo'] = Vars::model()->find("varname='FOOTERINFO'")->varvalue; }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. */ public function loadModel() { if ($this->_model === null) { if (isset($_GET['id'])) { $this->_model = Vars::model()->findbyPk($_GET['id']); } if ($this->_model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } } return $this->_model; }