While having separate frontoffice and backoffice is common, sometimes it's not enough. For example, you may need additional application for, say, a blog. In order to get it:
- Copy
frontoffice
toblog
,environments/dev/frontoffice
toenvironments/dev/blog
andenvironments/prod/frontoffice
toenvironments/prod/blog
. - Adjust namespaces and paths to start with
blog
instead offrontoffice
. - In
common\config\bootstrap.php
addYii::setAlias('blog', dirname(dirname(__DIR__)) . '/blog');
. - Make adjustments to
environments/index.php
(marked with+
):
return [
'Development' => [
'path' => 'dev',
'setWritable' => [
'backoffice/runtime',
'backoffice/web/assets',
'frontoffice/runtime',
'frontoffice/web/assets',
+ 'blog/runtime',
+ 'blog/web/assets',
],
'setExecutable' => [
'yii',
'yii_test',
],
'setCookieValidationKey' => [
'backoffice/config/main-local.php',
'frontoffice/config/main-local.php',
+ 'blog/config/main-local.php',
],
],
'Production' => [
'path' => 'prod',
'setWritable' => [
'backoffice/runtime',
'backoffice/web/assets',
'frontoffice/runtime',
'frontoffice/web/assets',
+ 'blog/runtime',
+ 'blog/web/assets',
],
'setExecutable' => [
'yii',
],
'setCookieValidationKey' => [
'backoffice/config/main-local.php',
'frontoffice/config/main-local.php',
+ 'blog/config/main-local.php',
],
],
];