Welcome Guest, Not a member yet? Register   Sign In
Dynamic Footers
#9

[eluser]eilrahc[/eluser]
wdcci: I asked a very similar question question a week or two ago. The solution in my case was using Colin's Template library.

I created a master template which contained the markup for a header, message area, content area, and footer. Then I simply write content to a region in the template with code like:

Code:
// Write some text into the 'page_title' region of the template
$this->template->write('page_title', 'Spiffy Title');
// Write another view into the 'content' region of the template, passing $data to it
$this->template->write_view('content', 'spiffy_view', $data);
// Send the completed markup to the browser
$this->template->render();

I don't know if the Template library is suitable for all projects, but so far I really dig it for mine. It drastically cut down the amount of repetition in my views at the cost of a few extra lines in my controller.


Messages In This Thread
Dynamic Footers - by El Forum - 08-09-2008, 05:18 PM
Dynamic Footers - by El Forum - 08-09-2008, 06:00 PM
Dynamic Footers - by El Forum - 08-09-2008, 06:47 PM
Dynamic Footers - by El Forum - 08-09-2008, 09:24 PM
Dynamic Footers - by El Forum - 08-09-2008, 10:36 PM
Dynamic Footers - by El Forum - 08-09-2008, 10:37 PM
Dynamic Footers - by El Forum - 08-10-2008, 08:00 AM
Dynamic Footers - by El Forum - 08-10-2008, 01:58 PM
Dynamic Footers - by El Forum - 08-10-2008, 04:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB