I don't quite understand how web2py url routing does its magic. For
something like this:
localhost:8000/welcome/default/products/*
where '*' can be some something which uniquely identifies a product in a
database, such as the primary integer id or a slug.
The identifier will then need to be passed to a function in the controller
so that I can use it to fetch the product from the database. Something like:
def products(identifier):
<grab item from database and process>
return dict(item=item)
Pattern-based routing seems like it might handle this, but the
docs<http://web2py.com/book/default/chapter/04#URL-rewrite> doesn't
really describe how to pass parameters to a function in the controller.
Can someone explain how to accomplish this?
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.