Welcome Guest, Not a member yet? Register   Sign In
Question regarding routing controllers
#4

[eluser]Zorancho[/eluser]
Yes, you need the database queries cause you must match the url since each is unique.
Good thing about this approach is that you can cache the pairs of keys => values:
[some-category/some-subcategory] => category_controller/subcategory_action
You will need only one controller like this and it's kinda like white list approach to urls.
Your solution is okay i think, also when you want to override some of the core classes, just create MY_Router.php file in your (application/libraries in CI < 2.0) (application/core in CI 2.0 if you are overriding core class) and extend the CI class.
Code:
class MY_Router extends CI_Router{
...
}
copy any of the methods that you want to override and insert your logic.
To understand the flow of every request in CI have a look at the system/codeigniter/CoddeIgniter.php file.


Messages In This Thread
Question regarding routing controllers - by El Forum - 01-18-2011, 03:21 PM
Question regarding routing controllers - by El Forum - 01-18-2011, 08:55 PM
Question regarding routing controllers - by El Forum - 01-19-2011, 03:15 AM
Question regarding routing controllers - by El Forum - 01-19-2011, 04:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB