Welcome Guest, Not a member yet? Register   Sign In
Default Template For All Views
#6

[eluser]gtech[/eluser]
create a template library, and then autoload it in config/autoload.php.. I havnt tested it but off the top of my head it might go somthing like:
Code:
<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
class Template {
    function dotemplate($template, $data)
    {
        $CI =& get_instance();
        $head = $CI->load->view('head','',TRUE);
        $main = $CI->load->view($template, $data,TRUE);
        $foot = $CI->load->view('foot','',TRUE);
        return $head.$main.$foot
    }
}
?>

[edit]ahh beaten to it[/edit]


Messages In This Thread
Default Template For All Views - by El Forum - 04-28-2008, 07:02 PM
Default Template For All Views - by El Forum - 04-29-2008, 02:38 AM
Default Template For All Views - by El Forum - 04-29-2008, 02:45 AM
Default Template For All Views - by El Forum - 04-29-2008, 03:57 AM
Default Template For All Views - by El Forum - 04-29-2008, 04:20 AM
Default Template For All Views - by El Forum - 04-29-2008, 04:32 AM
Default Template For All Views - by El Forum - 04-29-2008, 05:07 AM
Default Template For All Views - by El Forum - 04-29-2008, 05:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB