Answer the question
In order to leave comments, you need to log in
cnc not working in yii2?
urlManager:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'enableStrictParsing' => false,
'rules' => [
'' => 'index/index',
'info' => 'info/info',
'news' => 'news/news'
],
]
class IndexController extends Controller
{
public function actionIndex() {
return $this->render('index');
}
}
class InfoController extends Controller
{
public function actionInfo() {
return $this->render('info');
}
}
class NewsController extends Controller
{
public function actionNews() {
return $this->render('news');
}
}
Answer the question
In order to leave comments, you need to log in
When including urlManager, you need to add urlManager:
'request' => [
'baseUrl' => '',
'cookieValidationKey' => '...',
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question