Default Controller |
[eluser]Michael Wales[/eluser]
Quote:And the current spec is not intuitive. If URL is including sub directory, most people expect controllers in sub directory, doesn’t they?No... we read the user guide. CI supports Controllers in a subdirectory but it is by-far not the most popular feature, nor the standard of which most developers aim. Break yourself away from the thought that the controller and method names create your URL - they don't. Controllers and methods have absolutely nothing to do with your URL. Develop these names pragmatically. For instance - I want to show a user's profile. Obviously, I'll call my method profile and the class users but I don't want people to have to use domain.com/users/profile/walesmd to get to my profile, do I? That's hideous - so I route for domain.com/walesmd Another example: Recreating Wordpress in CodeIgniter, you could access the index method of the dashboard class by visiting domain.com/wp-admin Subdirectories should only be used for organizational purposes - not to try and trick CI into using prettier URLs. |
Messages In This Thread |
Default Controller - by El Forum - 06-08-2008, 02:26 AM
Default Controller - by El Forum - 06-08-2008, 02:45 AM
Default Controller - by El Forum - 06-08-2008, 02:20 PM
Default Controller - by El Forum - 06-08-2008, 03:47 PM
Default Controller - by El Forum - 06-08-2008, 04:15 PM
Default Controller - by El Forum - 06-08-2008, 10:43 PM
Default Controller - by El Forum - 06-10-2008, 08:17 AM
Default Controller - by El Forum - 07-07-2008, 07:24 PM
Default Controller - by El Forum - 07-11-2008, 02:44 AM
|