Exemple #1
0
	public function init(){
        $header = Header::model()->findByPk(1);
        $footer = Footer::model()->findByPk(1);
        $this->logoURL = Yii::app()->request->baseUrl.$header->logoURL;
        $this->smallLogoURL = Yii::app()->request->baseUrl.$header->smallLogoURL;
        $this->link1 = Yii::app()->request->baseUrl.$header->item1Link;
        $this->link2 = Yii::app()->request->baseUrl.$header->item2Link;
        $this->link3 = Yii::app()->request->baseUrl.$header->item3Link;
        $this->link4 = Yii::app()->request->baseUrl.$header->item4Link;
        $this->link5 = Yii::app()->request->baseUrl.'/graduate';
        //$this->imageSotial = Yii::app()->request->baseUrl.$footer->imageSotial;
        $this->imageUp = Yii::app()->request->baseUrl.$footer->imageUp;

        $app = Yii::app();
		if (isset($app->session['lg'])) {
			$app->language = $app->session['lg'];
		}
	}
Exemple #2
0
 /**
  * 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.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Header::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }