HMVC extension & routes |
[eluser]introvert[/eluser]
Hello, How should I set up a route to call controller within this structure: modules/catalog/products I tried all combinations but without success. What am I doing wrong? Thanks for help
[eluser]InsiteFX[/eluser]
Create a config directory in your module then add a routes.php file to it. Code: $route['product/(:any)'] = "modules/catalog/products/$1"; Something like that. See: CodeIgniter User Guide - URI Routing InsiteFX
[eluser]InsiteFX[/eluser]
Might be able to ask this question in the HMVC topic, but to keep with modules everything should be kept wirh the module! That's what allows you to just copy and use it in another application if need be. InsiteFX
[eluser]introvert[/eluser]
Is it impossible to define module routes in main config routes.php or is this just better practice?
[eluser]introvert[/eluser]
Thanks. One more thing: should I set autoload option in case if I want to have routes defined within modules or will CI auto load all of them?
[eluser]InsiteFX[/eluser]
I may be wrong here, but I think HMVC and CodeIgniter handles it. InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |