Moving configuration parts into separate files
In the basic application template we have separated web and console configuration files. And usually we set some application components in the both the configuration files.
Moreover, when we develop a big application, we may face some inconvenience. For example, if we need to adjust some settings, we would most probably end up repeating the changes in both the web application config and console application config.
Getting ready
Create a new yii2-app-basic
application by using the Composer package manager, as described in the official guide at http://www.yiiframework.com/doc-2.0/guidestart-installation.html.
How to do it...
- Open the
config/web.php
file and add theurlManager
section to the components configuration:'components' => [ // ... 'db' => require(__DIR__ . '/db.php'), 'urlManager' => [ 'class' => 'yii\web\UrlManager', 'enablePrettyUrl...