本文整理匯總了PHP中Header::model方法的典型用法代碼示例。如果您正苦於以下問題:PHP Header::model方法的具體用法?PHP Header::model怎麽用?PHP Header::model使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Header
的用法示例。
在下文中一共展示了Header::model方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
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'];
}
}
示例2: loadModel
/**
* 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;
}