Yii2-具有后端分支的高级模板

Yii2-具有后端分支的高级模板,yii,yii2,Yii,Yii2,请引导 我曾经用一个基本模板创建了一个Yii2应用程序。 现在,我转到高级模板 因为我面临这样的问题 比如说,我们有总部和分公司。 我的问题是应用程序的结构 - backend - frontend 我有两个问题,如果我的结构是这样的: - backend-master (abstract/interfaces class is came from this) - backend-headquarters - backend-branch-offices-1 - backend-branch-

请引导

我曾经用一个基本模板创建了一个Yii2应用程序。 现在,我转到高级模板

因为我面临这样的问题

比如说,我们有总部和分公司。 我的问题是应用程序的结构

- backend
- frontend
我有两个问题,如果我的结构是这样的:

- backend-master (abstract/interfaces class is came from this)
- backend-headquarters
- backend-branch-offices-1
- backend-branch-offices-2
- frontend
  • 这是一种好的方法吗
  • 如何将一个布局的web应用于所有后端
  • 请告知

  • 不,你只需要一个子模块。不是像这样一个单独的后端模块

  • 您可以将每个子模块配置为在每个子模块配置中使用后端模块内任何子模块的视图文件

  • backend/module/headquaters/module/config/main.php(我假设)

    'components' => [
        ... other components
        'view' => [
            'theme' => [
                'pathMap' => [
                     // you may specify any directory as your view directory from here
                    '@backend/views' => '@backend/views',
                    '@frontend/adminlte/views' => '@frontend/themes/adminlte/views',
                ],
            ],
        ],
         ... other components