'latest' => $latest, ]); } public function actionView($slug) { $page = Category::find()->where(['slug'=>"news", 'status'=>1])->one(); $news = History::find()->where(['status'=>1, 'slug'=>$slug ])->one(); $this->registerMeta($news->meta->title,$news->meta->description,$news->meta->keywords); $newsLast = History::find()->where(['status'=>1])->orderBy(['date'=>SORT_DESC])->limit(10)->all(); return $this->render('view', [ 'page' => $page, 'newsLast' => $newsLast, 'news' => $news ]); }
} public function actionView($slug) { $page = Category::find()->where(['slug'=>"news", 'status'=>1])->one(); $news = History::find()->where(['status'=>1, 'slug'=>$slug ])->one(); $this->registerMeta($news->meta->title,$news->meta->description,$news->meta->keywords); $newsLast = History::find()->where(['status'=>1])->orderBy(['date'=>SORT_DESC])->limit(10)->all(); return $this->render('view', [ 'page' => $page, 'newsLast' => $newsLast, 'news' => $news
/** * Returns all ancestor modules of this controller. * The first module in the array is the outermost one (i.e., the application instance), * while the last is the innermost one. * @return Module[] all ancestor modules that this controller is located within. */ public function getModules() { $modules = [$this->module]; $module = $this->module; while ($module->module !== null) { array_unshift($modules, $module->module); $module = $module->module;
require(__DIR__ . '/../../common/config/main.php'), require(__DIR__ . '/../../common/config/main-local.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); (new yii\web\Application($config))->run();
$_GET = [ 'slug' => '_2', ];