Welcome Guest, Not a member yet? Register   Sign In
Simple template library
#2

[eluser]xwero[/eluser]
I wonder why you limited the library to a header and a footer. This means the header has to contain the start html tag + the head tag + start body tag and the footer has to contain the end of the body and html tag. What if you want to reuse the header you have to make make a new file because the head content will be different.

I think it's a good exercise for yourself but i'm not sure it's an improvement on CI's view functionality. Your example can be written as
Code:
$this->load->view('default/header',array('title'=>"My fancy new title"));
$this->load->view('someview',$somedata);
$this->load->view('anotherview', $moredata);
$this->load->view('default/footer');
If the library gets autoloaded you only lose one line.

I think if you get annoyed by adding the same parts over and over you better use a base template and add content to it.


Messages In This Thread
Simple template library - by El Forum - 12-15-2008, 04:58 PM
Simple template library - by El Forum - 12-16-2008, 01:57 AM
Simple template library - by El Forum - 12-16-2008, 02:24 AM
Simple template library - by El Forum - 12-16-2008, 03:04 AM
Simple template library - by El Forum - 12-16-2008, 04:19 PM
Simple template library - by El Forum - 12-17-2008, 01:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB