return $this->render('index', ['model' => $model]); } } protected function findModel($slug) { if (($model = Page::findOne(['slug' => $slug])) !== null) { return $model; } throw new NotFoundHttpException('The requested page does not exist.'); } }
$_GET = [ 'slug' => 'gioi-thieu', ];