Welcome Guest, Not a member yet? Register   Sign In
templete , what is the smatter way ?
#1

[eluser]learnq[/eluser]
Hi,

I am creating a site and like other site its header and footer is same and left/right menu changes for specific pages + conttent area always change.
now I code like

function f()
{
...
.....
$this->parser->parse('header',$demo);
$this->parser->parse('left_content',$data);
$this->parser->parse('static_content',$data);
$this->parser->parse('right_content',$data);
$this->parser->parse('footer',$demo);

}

now for every contoller&its;functions ...I need to mention all five lines and run mysql
query to get the data.Though I am using mysql cacheing .

Is there a smatter way ? Mean I only want to change ..the portion of the page
which is needed.

Hope it clear Smile thanks.
#2

[eluser]garrettheel[/eluser]
Check out the template libraries in the Ignited Code section.

I wrote a really simple one that could achieve this here:

http://ellislab.com/forums/viewthread/99892/

Otherwise, here's another good (and more expandable) one:

http://ellislab.com/forums/viewthread/88452/




Theme © iAndrew 2016 - Forum software by © MyBB