I was unsure about what to call this question but here is my problem:
I am creating a webshop in Cakephp. For this purpose i have alot of different categories that is bound to a static menu line.
Now regardless of where you are on the webshop you will be able to see these categories
.
All the categories
are stored in the database
and then looped into the default layout (meaning that if i add a new category it will automaticly add it self to the menu line).
My question is since all of these categories has to be fetch no matter where you are in my application how do i collect them?
Only way i can think of is collecting them in every controller
and set them to a $_SESSION
variable and then check if the variable is set.
I know there must be another way but how?
Im using CakePHP 2.4
Also the menu of my application is stoped in Layouts->default.ctp
which means that it does not "care"
which controller or action you are in. Meaning that the categories must be loaded before the actions