Hi,
In my application, i have:
- a table storing customers' orders, and
- a table storing order entries
so basically a one-to-many relationship between the orders table and the orders entries table (should be quite a common structure).
i have a page that display all of a customer's orders (but not the entries). This part is simple, in my OrdersController, i have a viewAllOrdersAction which queries the DB, and send the results to the view for rendering.
Now, the next thing i want to do is, when the user clicks on a specific order, i want to go to a page which shows all the entries for that order.
i suppose i will need to add a viewOrderAction to the OrdersController which again queries the DB and send results to another view.
The question i have is regarding sending the orderId from the viewAllOrders page to the viewOrderAction and retrieving it there.
What is the right way to do this?
- Should i do a very simple form with a hidden orderId field and a link which does a submit? it does seem overkill...
- Or should i just compose a link URL with "?orderId=12345"? i would suppose this would be the better way, but how do i construct a URL with a GET param using the Zend_View's URL helper (i.e. the $this->url(...) in a view)?
Thanks!