Welcome Guest, Not a member yet? Register   Sign In
Dynamic Controller Names
#9

[eluser]Ki[/eluser]
I have had a similar problem and i have solved it with editing routes.php in your config folder to forward anything after ...restaurants/ to restaurants controller, which only has one method - index($restaurant_name). So, if you type restaurants/my_grill or restaurant/johns_grill, it will be passed to controller restaurant, method index($restaurant_name) with the variable $restaurant_name catching anything in the url after restaurant/. Further, within the index, if you are using database, you can use the IF(){} to see if the $restaurant_name matches a name in database and display the menu, or else show view that says something like "NO RESTAURANT FOUND". Hope that helps, if I understood correctly.


Messages In This Thread
Dynamic Controller Names - by El Forum - 05-17-2009, 07:29 PM
Dynamic Controller Names - by El Forum - 05-17-2009, 07:43 PM
Dynamic Controller Names - by El Forum - 05-17-2009, 08:17 PM
Dynamic Controller Names - by El Forum - 05-17-2009, 10:15 PM
Dynamic Controller Names - by El Forum - 05-18-2009, 02:37 AM
Dynamic Controller Names - by El Forum - 05-22-2009, 10:15 AM
Dynamic Controller Names - by El Forum - 05-23-2009, 12:50 PM
Dynamic Controller Names - by El Forum - 05-23-2009, 01:00 PM
Dynamic Controller Names - by El Forum - 05-24-2009, 05:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB