コード例 #1
0
 public function loadModel($id)
 {
     if (($model = SocialLink::model()->findByPk($id)) === null) {
         throw new CHttpException(404, Yii::t('SocialLinkModule.sociallink', 'Page was not found!'));
     }
     return $model;
 }
コード例 #2
0
 public function run()
 {
     $models = SocialLink::model()->cache($this->controller->yupe->coreCacheTime)->published()->findAll(['order' => 't.sort']);
     if (empty($models)) {
         return;
     }
     $this->render($this->view, ['models' => $models]);
 }