Welcome Guest, Not a member yet? Register   Sign In
Dynamic Route to Specific Controller
#6

[eluser]pickupman[/eluser]
For what you are doing, you almost need to create routes for each controller that will have rewritten url's. You will probably also need three rules. The routing feature works like mod_rewrite, where CI will take the first match. Therefore, you need to make sure you have them ordered correctly.
1.) uri = /reviews/
2.) url = /reviews/65
3.) uri = /reviews/write/65
In each scenario, you need a way to protect against errant url's say someone uses a product id that doesn't exist. Or where does someone go when they only have /reviews/ without a product id at all?
The rsegment function should work as advertised.

How about you post your actual routes.php file or at least the block of uri routes?


Messages In This Thread
Dynamic Route to Specific Controller - by El Forum - 06-30-2010, 12:55 PM
Dynamic Route to Specific Controller - by El Forum - 06-30-2010, 01:34 PM
Dynamic Route to Specific Controller - by El Forum - 06-30-2010, 02:08 PM
Dynamic Route to Specific Controller - by El Forum - 06-30-2010, 04:05 PM
Dynamic Route to Specific Controller - by El Forum - 06-30-2010, 05:18 PM
Dynamic Route to Specific Controller - by El Forum - 06-30-2010, 09:10 PM
Dynamic Route to Specific Controller - by El Forum - 07-01-2010, 07:45 AM
Dynamic Route to Specific Controller - by El Forum - 07-01-2010, 07:57 AM
Dynamic Route to Specific Controller - by El Forum - 07-01-2010, 08:10 AM
Dynamic Route to Specific Controller - by El Forum - 07-01-2010, 08:23 AM
Dynamic Route to Specific Controller - by El Forum - 07-01-2010, 10:16 AM
Dynamic Route to Specific Controller - by El Forum - 07-01-2010, 10:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB