RE: [PHP] dynamic menu with show hide capabilities - understanding possible workflow
| From: | MEM | Date: | Tue, 27 Oct 2009 11:39:11 +0000 |
| Subject: | RE: [PHP] dynamic menu with show hide capabilities - understanding possible workflow | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-299373@lists.php.net to get a copy of this message | ||
>That sounds about right yeah. You could also get a little bit clever and only retrieve the rows
>from your db that >will go to make the array elements you'll need. It doesn't make
>sense to retrieve a full product list each time >someone visits the page,
Ok.
>so you only need to retrieve those that the user is interested in, which is shown by what they
>click on.
The relation between click and the display of the corresponded array child elements, without using
js, is the hardest to understand:
The user will click on a link / the URL will change / the new page will be loaded to the user / the
information displayed on that page should be related with the element clicked on the first step.
So, the next page, should know what we have clicked before, in order to display the information
accordingly.
One of the ways that this can be done, is by passing params over the URL. The URL param will tell us
what element have we clicked, so it should be based on URL. Once we have that, we need to ask: as
that value passed on the url a correspondent array element that contains children? If so, display
them.
(I realize my incapacity of talking technically, by referring to "pages" and other odd
entities. I'm sorry for that).
Does the above makes any sense?
Thanks a lot,
Márcio