本文整理汇总了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;
}