Hello friends. I'm looking for how to make a dynamic menu (the data are brought from a database) and the menu, looks around the site, in all modules and controllers. What would be the best option for this?
thanks friends.
Hello friends. I'm looking for how to make a dynamic menu (the data are brought from a database) and the menu, looks around the site, in all modules and controllers. What would be the best option for this?
thanks friends.
I personally would have made a controller that generates the menu by populating a model with the menu hierarchy from the database and calls a template to render an HTML fragment of the menu. The you can call that controller from your primary template.
I would use a haleper as long as the ActionStack and action helper are resource intensive. Create a view helper and access the model from there. Or send the menu data to view from controller and use the helper to render it.
I personally use the ActionStack, it's not that resource intensive as they say, it only pushes one more action in the dispatcher, and from there pull the data from a Model and inject it to a named segment on the view.