/** * Index Action * @return string */ public function actionIndex() { $provider = new ActiveDataProvider(['query' => Article::find()]); return $this->render('index', ['model' => Article::className(), 'provider' => $provider]); }
/** * Get articles for this category. */ public function getArticles() { return $this->hasMany(Article::className(), ['cat_id' => 'id']); }