Adding context sensitive menus to codeigniter controllers

Dev

New Member
I have created a generic "Page" controller for my site. These pages serve up mostly static information, they pull the most recent version of the page contents, and the update date from a database. On each page they have a section menu and a resource menu. The section menu is dictated by what logical section of the site the page resides in. The resource menu holds links to resources associated with that page, documents, offsite-links, links to calender events, etc. These resources are page specific and also pulled from a database.Currently the Page controller generates them and places them in the view, but I am staring work on other controllers that may have only one, both, or none of the menus. Should I continue having the menu selection and generation be a function of the Page controller and copy paste it to new controllers? Or should I somehow break out the menu lookup and generation functions into some other object (library, helper, or plugin)? And if so how should I break it out? Or how else should I implement it?
 
Back
Top