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