Welcome Guest, Not a member yet? Register   Sign In
Templating question?
#6

[eluser]Sean Gates[/eluser]
So, to your original question regarding a "header controller": you should only use controllers as the logic of the site, and not as a way to display content. If you need to display anything, it should be done in a view.

There are a couple other strategies:

1) Create a MY_Controller that is the base controller for the class and do the header logic in the __construct()
2) If using PHP5 declare the method of a controller "private": private function _header(){ ... } ... and call it whenever you need the header to display: _header();

Let me know if these make sense. I've done it many different ways.


Messages In This Thread
Templating question? - by El Forum - 01-18-2010, 09:51 AM
Templating question? - by El Forum - 01-18-2010, 10:04 AM
Templating question? - by El Forum - 01-18-2010, 11:27 AM
Templating question? - by El Forum - 01-18-2010, 04:00 PM
Templating question? - by El Forum - 01-24-2010, 09:33 PM
Templating question? - by El Forum - 01-24-2010, 10:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB