Example #1
0
 public function actionIndex()
 {
     $data = new ActiveDataProvider(['query' => Page::find()->desc()]);
     return $this->render('index', ['data' => $data]);
 }
Example #2
0
 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);
 }