Creating a Template Helper for CodeIgniter

first you create /helper/template_helper <?php if (! function_exists(‘renderPage’)) { function renderPage($view, $data){ $CI =& get_instance(); $CI->load->view(‘t/header’, $data); $CI->load->view($view, $data); $CI->load->view(‘t/footer’); } } then in controller you can call function like this function index(){ $this->load->helper(‘template’); $data[‘name_title’] = ‘Title Page In Head Tag’; renderPage(‘index_view’,$data); } source: http://varun1505.com/blog/2013/09/01/creating-a-template-helper-for-codeigniter/ Advertisements Continue reading Creating a Template Helper for CodeIgniter