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; }
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]); }