Models shared between two (or more) apps


I want to make two separate apps: Backoffice and Frontoffice.

But both share the same models (obviously) and the folder structure and the configuration does not give me any hint how to do this.

Any ideas? Thanks in advance


I write my own autoloader class and include it in my index.php file.

Notice that include before calling 'require_once($yii);' line.


another solution could be to use module. you can do a module BackOffice and a module FrontOffice for example.


I share the same model of my site and admin in this way:








Ok I’ll try to use the modules aproach :D

You spice it with modrewrite?

have you read this? http://www.yiiframew…oc/cookbook/33/


have you read this? http://www.yiiframew...oc/cookbook/33/

Actually no. I went to the cookbook and search on Google but it gave no meaningful results… Maybe the cookbook articles should be more featured and they should really have a RSS feed.

But I went with the modules approach. Its what makes for sense to me and I'll use rewrite rules to redirect to the correct module.

Btw this is the best framework I've ever used. And I used a LOT in some projects. The way modules, sub-modules, layouts are intuitively processed is awesome. I once made an mvc framework for my projects and this is what I intended to achieve. Continue your great work. Soon Yii will be as featured as Cake and Symfoni.