Welcome Guest, Not a member yet? Register   Sign In
Improve routes rule help
#4

[eluser]mddd[/eluser]
Ok, I get it. But you do realise that the user will then not be able to link to that page, or bookmark it!
Because if the user bookmarks it, it will only say '/shop/pizza' and if the user comes back to that page, your site will not be able to produce that page again!

If you still want to do it, you could make a controller that stores the information in a session and then redirects the browser to your '/shop/pizza' page. On that page you read the information from the session and you're done.

But I think it's the wrong way to go. It is a bad idea to try to show the user something else than the real url. You'd much better make sure that the real url contains something useful. For instance, if '203' is the id of some pizza shop, you could make your route to /shop/pizza/203/my-great-pizza-shop.
You can read the id you need from the url (203) and the url is human-readable as well. That will make the url logical for a user.
You could even use /shop/pizza/my-great-pizza-shop, but then you would have to make sure that there are no shops with the same name.


Messages In This Thread
Improve routes rule help - by El Forum - 04-20-2010, 06:49 AM
Improve routes rule help - by El Forum - 04-20-2010, 07:27 AM
Improve routes rule help - by El Forum - 04-20-2010, 07:35 AM
Improve routes rule help - by El Forum - 04-20-2010, 07:43 AM
Improve routes rule help - by El Forum - 04-20-2010, 07:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB