Skip to content

Displaying Multiple Templates

World Wide Web Server edited this page Jul 4, 2012 · 11 revisions

When you try and load more than one View (for whatever reason) in one function, you see that it simply just won't work. There are a bunch of ways to do this

MAIN template

[code] <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>{title}</title> <link href="/css/css.css" rel="STYLESHEET" type="TEXT/CSS" /> </head>

<body>

logo
{navside}
{intro}
{bread}
{navtop}
{middle}
{foot}

</body> </html> [/code]

MAIN controller [code] [code] [code] $maindata['navside'] = $this->parser->parse('navside',$data,true); $maindata['intro'] = $this->parser->parse('intro',$data,true); $maindata['bread'] = $this->parser->parse('bread',$data,true); $maindata['navtop'] = $this->parser->parse('navtop',$data,true); $maindata['middle'] = $this->parser->parse('cust/view',$data,true); $maindata['foot'] = $this->parser->parse('foot',$data,true);

$this->parser->parse('main',$maindata); [code]

Category:Templates

Clone this wiki locally