I am working on a web application. This might be a silly question, but I want to know whether I am taking the good approach to this or not. I want to have multiple views on one single view/page.
The Codeigniter documentation says that "A view is simply a web page, or a page fragment, like a header, footer, sidebar, ...".
I want to have a header, some quick search view, some other view and a footer for a example. Should I implement a controller to every view (header, quick search, footer, ...), or is it better to implement every view functions in a single controller? For instance, if I know that the header, footer, quick search views are going to always be there (even if their content might change) should I put functions for all those views in one controller?
Please, help.
one approach is to have a template view that has the elements you require. see this pseudo-code example... so, template_view.php has:
your single controller then calls the template with the parameters for each view.