Welcome Guest, Not a member yet? Register   Sign In
Modular Separation and default controller
#6

[eluser]Phil Sturgeon[/eluser]
[quote author="loosetops" date="1281575118"]It says that but you have to define the default controller with a module name.

I wanted to hack my MS so I could $route['default_controller'], then I realized it would have made it messy. Since all the routes are loaded at the same time you would have to resolve the 'default_controller' key in every routes file(except the top one) to avoid collision.

This would make MS less efficient yet we could have just used the module_name to begin with. I'm guessing the MS creator thought about it. That line in the wiki should be expounded upon to mention using the module_name as the key.[/quote]

You are part right and part wrong.

The initial routes library is parsed then the module library is parsed. MS will not parse EVERY routes file as there is no point. This is something that Matchbox does and it doesn't work very well.

MS does allow you to create a default controller for your module, but not using default_controller. You can use:

Code:
route['module_name'] = 'my_controller'; // right

like you suggested.


Messages In This Thread
Modular Separation and default controller - by El Forum - 08-10-2010, 08:24 PM
Modular Separation and default controller - by El Forum - 08-11-2010, 01:42 PM
Modular Separation and default controller - by El Forum - 08-11-2010, 01:44 PM
Modular Separation and default controller - by El Forum - 08-11-2010, 02:05 PM
Modular Separation and default controller - by El Forum - 08-11-2010, 04:54 PM
Modular Separation and default controller - by El Forum - 08-17-2010, 08:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB