YII2 custom directory structure

Hi all,

i developed a project with Yii2 basic application, now I want to change directory structure to make it similar to the advanced app, anyone can help me??


What’s the problem?

Hi samdark thank you for the reply,

I am having various problems with namespace, resources not found etc…

To be more precise I have an app to which i have to attach different modules that use the same db so what i would like to do is


  • app1

    • config


    • models

    • view

  • app2

and so one for each module i need to develop

I am not abe to understand how to re-route the various Yii2 calling to different resources

Solve issues one by one.

Yes now I am triyng to create a common direcotry to put in login and some other common function but it still not working giving me this error:

Exception ‘yii\base\InvalidParamException’ with message ‘The file or directory to be published does not exist: C:\xampp\htdocs\gcf\common\vendor\bower/jquery/dist’

in C:\xampp\htdocs\gcf\vendor\yiisoft\yii2\web\AssetManager.php:386

But $path in assetmanager is giving me the right path…

Is there "C:\xampp\htdocs\gcf\common\vendor\bower/jquery/dist"?

I have solved using module logic, without change alla the directories structure.

Now I have a problem with only one controller call which gives me error 404 also if everything is correct.

my url is:


There is no camel case in the url nor in the class name

I don’t understand why, because with the other controllers everything works fine.

I have tried to force id in the action and it works, but if i send it through url i get 404.