URI Routing, How to pass ID into method? |
[eluser]TomRPS[/eluser]
The docs show this example route: Code: $route['product/(:num)'] = "catalog/product_lookup_by_id/$1"; I have been trying to use this example to test how to get an ID into a method. So far nothing has worked. In the example it has "$1" which I assume is supposed to be the ID. Is this correct and does it have to be $1 or can it be something else? What do I put in my method's parameter? In the case of the above route a request to http://mysite.com/product/4323 would be routed to catalog.php and product_lookup_by_id method So if I have the method: Code: public function product_lookup_by_id($id) Does the name of the parameter ($id in this case) matter? If so what should it be. When I use the code above all I get is a blank page. |
Messages In This Thread |
URI Routing, How to pass ID into method? - by El Forum - 03-20-2012, 12:40 PM
URI Routing, How to pass ID into method? - by El Forum - 03-20-2012, 03:19 PM
|