troubleshooting Question

Zend Framework - loading data at startup

Avatar of gublooo
gubloooFlag for India asked on
Web DevelopmentPHP
3 Comments1 Solution327 ViewsLast Modified:

I am new to Zend and am trying to learn what are the best practices.
One of the things I am doing is loading all the menu items from the database - that will be shown in all the pages of the website.

Now instead of pulling the items everytime - I want to pull the items once and store them in the session or namespace and just read it from the session and display it everytime the page is accessed.

At which place am I supposed to load this data from DB and store in session. Should this be done in bootstrap.php - It cant be done in the main index controller as a user might now always come from the main page.

So it advisable to load such things in the bootstrap.php or how else is it done.

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros