Difference between #2 and #3 of
Changing Controllers Name

Revision #3 has been created by Trejder on Apr 29, 2013, 9:08:37 AM with the memo:

fixed Markdown formating typos
« previous (#2)


Title unchanged

Changing Controllers Name

Category unchanged


Yii version unchanged

Tags unchanged

newbie, controllers

Content changed

### Changing Controller Name

If you wish to change not only URLs (which can be done with URL Management --> see [here](http://www.yiiframework.com/doc/guide/1.1/en/topics.url "URL Management")), but also controllers names (for example for some files and folders structure cleanup or for satisfying defined name nomenclature), you will have to undertakes theses four steps:

1. Change controller's file name, for example from _SiteController.php_ to _MainController.php
_". 2. Edit this controller file and change class name, in the first code line, for example from _SiteController_ to _MainController_" (see end of this chapter).
3. Change views folder name, for example from _protected/views/site_ to _protected/views/main_.
4. If this is main (default, major) controller, edit application configuration file and inform Yii about change in application or module default controller name.

For application:
4 0
Viewed: 23 403 times
Version: 1.1
Category: How-tos
Written by: Trejder
Last updated by: Trejder
Created on: Dec 9, 2010
Last updated: 8 years ago
Update Article


View all history