This site is built using CakePHP 1.2*I have an element that needs to be placed in multiple views under multiple controllers. This element is very dynamic, every time a page is loaded it needs to call a function (which is rather large) and then display what was returned. There are a few options that I have thought of, none of which I am sure are the correct way of doing this.
- Placing this function within app_controller and then somehow calling it from the element
- create a helper and then including it in every controller that will display the element.
- creating a component and then including it in every controller that will display the element.