public function actionIndex() { $data = new ActiveDataProvider(['query' => Page::find()->desc()]); return $this->render('index', ['data' => $data]); }
private function findPage($id_slug) { $page = PageModel::find()->where(['or', 'page_id=:id_slug', 'slug=:id_slug'], [':id_slug' => $id_slug])->one(); return $page ? new PageObject($page) : $this->notFound($id_slug); }