Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Emran Hasan' Blog:
Changing the default controller naming convention in CodeIgniter
Sep 21, 2009 @ 14:43:09

Emran Hasan has a quick new post to his blog today looking at how you can change the default controller naming scheme that the CodeIgniter framework uses (to prevent things like naming conflicts and the like).

CodeIgniter is one of my favorite framework and I often use it for developing application quickly. Although it is very flexible in most cases, I find its naming convention to be strict. Many times I have faced this problem when my controller’s class name and a model/library's class names are the same – a Fatal error is inevitable.

His method involves extending the core CI_Router class to change the _validate_request method to change the location and the naming convention (from Users to UsersController) for the default controller settings. Code for the update is included.

tagged: codeigniter naming controller default tutorial

Link:


Trending Topics: