Running a database query before every route runs
问题 So I am using Slim Framework, idiorm and twig to build an application and have a separate template file for my menu which is included on every page. The menu has a select menu that is generated from a database query and so needs to be included on every route. How can I have this query call on every route without actually declaring it on every route. Can I use the hook system. I am not sure how to tackle this. I hope that makes sense. Thanks 回答1: Yes you're right, you could use the hook with