/**
  * Detail Action of Article
  *
  * @param integer $id
  * @param string $title
  * @return \yii\web\Response|string
  */
 public function actionDetail($id, $title)
 {
     $model = Article::findOne($id);
     if (!$model) {
         return $this->goHome();
     }
     return $this->render('detail', ['model' => $model]);
 }
Example #2
0
 public function extraVars()
 {
     return ['items' => Article::getAvailableNews($this->getCfgValue('limit', 10))];
 }
Example #3
0
 /**
  * Get articles for this category.
  */
 public function getArticles()
 {
     return $this->hasMany(Article::className(), ['cat_id' => 'id']);
 }