Theming And Organizing Directories (Discussion)

I had posted this topic in Miscellaneous by the request of Yii mamber fouss to discuss wiki article Organize directories for applications with front-end and back-end using WebApplicationEnd behavior as he has some question/doubt

I just wanted to say that the way kiskp and hnam descried to create a theme is not like a standard yii theming.

Because if you make like they said it simply move you protected/view folder to theme folder and all your view file should be in this theme folder… that is not a theme.

Do you see what I mean?

No fouss,

what they said is just like theming, as kiskp said that are only view files as you can see.

the controller and model files/folder will not change, if you want to use any theme you had to change in config file like [color=#222222][font=Menlo, Consolas,]‘theme’=>‘classic’ or ‘theme’=>‘mytheme’ …[/font][/color]

You’re right about saying “it’s like theming” but it is not.

So is there a way to make real theming using this directory organisation?

in most of systems we had same structure as different theme folders ( e.g wordpress ) generally on root folder …

and what is [color="#1C2837"][size="2"]real theming???[/size][/color]

[color="#1C2837"] [/color]

[color="#1C2837"][size="2"]Please share if you had better idea…[/size][/color]

When I say "real theming" I mean the way it is made with yii as usual.

Yes i got what you want to say,

but i m just saying that plz share if you had any other structure/idea to make theming better


plz share why you think to change/update current structure… …


Two questions:

  1. Did anyone combine this with the rights extension? How do you guys handle identical controller names on different endpoints, but different right access rules?

  2. How do you create urls between endpoints? For example a link from back to front?




Thanks for a great article. I’m new to Yii, and have successfully set up a separation between backend/front following your article.

I have one problem.

When I link to internal pages by setting controller/action, they all igonre the backend/-part of the url.

Can I set this up in back.php (config), so that every url generated in backend, routes to backend/controller/action?

If I go to url backend/controller/action, I get correct view, but when links are generated, they are wrong.

No problems when creating the menu, since I just add "backend" to the link, but when I use CGridView (ie), there are a lot of autogenerated urls.

Hope someone can help:) Thanks!


Just got it to work. Had to move the front-routing from main.php to front.php.

My bad:)

There a couple of comments on the wiki about problems with urls in the backend but no solution. Everything seems to work until I add the lines to the back configuration file.










Results in the error Property "CWebApplication.urlManager" is read only.

Any way to fix this?

faced with two problems when sharing BackEndController ( and


  1. I can not close the class RegistrationController extends YumRegistrationController


  1. not connected layout when entering the user/user/admin