0

i need to put admin controllers in subfolder like this
app\controllers\adpanel\AdminsControllers.php
also put view in subfolder like this:
app\views\adpanel\login.php
app\views\adpanel\dashboard.php

is this possible?what should i do?

Hamidreza
  • 1
  • 1
  • Yes, you can use 'controllerMap' into your condig/main.php read the [docs](https://www.yiiframework.com/doc/guide/2.0/en/structure-controllers#controller-map) – Sfili_81 Jul 14 '20 at 10:06
  • i use yii2 basic i have config/web.php.i dont know how to use 'controllerMap' – Hamidreza Jul 14 '20 at 13:38
  • I don't remember in what part of documentation it's explained, but read carefully and you will find. config/web.here you can set – Sfili_81 Jul 14 '20 at 14:11
  • 2
    You also can configure an use modules instead of mapping controllers in sub folders, you will achieve a better structure and keep all clean https://www.yiiframework.com/doc/guide/2.0/en/structure-modules – ustmaestro Jul 14 '20 at 14:30

0 Answers0