/** * 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]); }
public function extraVars() { return ['items' => Article::getAvailableNews($this->getCfgValue('limit', 10))]; }
/** * Get articles for this category. */ public function getArticles() { return $this->hasMany(Article::className(), ['cat_id' => 'id']); }