public function actionIndex() { $this->layout = '/adminka-admin'; $video_categoria = VideoCategoria::find()->all(); $authors = Author::find()->all(); return $this->render('index', ['video_categoria' => $video_categoria, 'authors' => $authors]); }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = VideoCategoria::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if ($this->load($params) && !$this->validate()) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id]); $query->andFilterWhere(['like', 'name', $this->name]); return $dataProvider; }
public static function getModel() { return VideoCategoria::find()->all(); }