Welcome Guest, Not a member yet? Register   Sign In
Controller Suffix
#8

(08-08-2016, 01:56 PM)PaulD Wrote:
(08-08-2016, 11:59 AM)Muzikant Wrote: Hi. Add the following lines to /application/config/routes.php file:

PHP Code:
$route['welcome/(:any)'] = 'welcome_controller/$1';
$route['welcome'] = 'welcome_controller'

Also read more about URI routing in the documentation: http://www.codeigniter.com/user_guide/ge...uting.html.

Thats a  great answer.

But it still does not answer why you would want _controller on the end of every controller. And you would have to write those route pairs for every controller just to get around it.

Writing out your routes is a good practice  Wink . Also, I'm sure it's a force of habit from someone coming from another framework. I do the same thing coming from a Ruby on Rails background.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply


Messages In This Thread
Controller Suffix - by ufhy - 08-05-2016, 08:56 AM
RE: Controller Suffix - by Avenirer - 08-07-2016, 10:31 PM
RE: Controller Suffix - by PaulD - 08-08-2016, 09:09 AM
RE: Controller Suffix - by ivantcholakov - 08-08-2016, 10:41 AM
RE: Controller Suffix - by Muzikant - 08-08-2016, 11:59 AM
RE: Controller Suffix - by PaulD - 08-08-2016, 01:56 PM
RE: Controller Suffix - by albertleao - 08-12-2016, 05:29 PM
RE: Controller Suffix - by marksman - 08-08-2016, 06:13 PM
RE: Controller Suffix - by PaulD - 08-12-2016, 05:57 PM
RE: Controller Suffix - by albertleao - 08-14-2016, 10:21 PM
RE: Controller Suffix - by PaulD - 08-15-2016, 03:00 AM
RE: Controller Suffix - by albertleao - 08-15-2016, 09:52 AM
RE: Controller Suffix - by spjonez - 08-15-2016, 07:41 AM
RE: Controller Suffix - by Ivo Miranda - 08-15-2016, 12:14 PM
RE: Controller Suffix - by albertleao - 08-15-2016, 02:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB