Esempio n. 1
0
 /**
  * Displays a single Cms model.
  * @param integer $id
  * @return mixed
  */
 public function actionView($id)
 {
     $model = $this->findModel($id);
     $pagedata = Page::findOne($model->pageid);
     $cmspoaitiondata = Cmsposition::findOne($model->cmspositionid);
     $model->pageid = $pagedata->name;
     $model->cmspositionid = $cmspoaitiondata->name;
     //$model->imgurl = Yii::$app->request->hostInfo.'/'.$model->imgurl;
     return $this->render('view', ['model' => $model]);
 }
Esempio n. 2
0
 /**
  * Finds the Cmsposition model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Cmsposition the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Cmsposition::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }