Welcome Guest, Not a member yet? Register   Sign In
My_Template class
#3

[eluser]ericsodt[/eluser]

If interested in using my idea.. my 'template' system works like struts tiles (j2ee programming - if not familiar)



I have a simple layout file [siteLayout.php]

Code:
<?
    include('header.php');


    $this->load->view($content);


    include('footer.php');
?>


Then from my controllers I 'inject' my content


Code:
$data = array(
               'title' => 'My Page',
               'content' => 'home',
               'breadcrumbs'=>< breadCrumbInfomation >
        );

         $this->load->view('siteLayout',$data);


As you can see I load siteLayout, then inject the contents of home.php into it below the header and above the footer.



This is a real simple way to do templating and works well for me. I hope it does the same for you



Cheers


Messages In This Thread
My_Template class - by El Forum - 12-16-2008, 02:49 PM
My_Template class - by El Forum - 12-16-2008, 03:14 PM
My_Template class - by El Forum - 12-16-2008, 03:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB