Welcome Guest, Not a member yet? Register   Sign In
Integrating a Template with CodeIgniter 3
#4

instead of calling the view "maincontent", i've put in references to $content1, $content2, etc. Because we are doing if isset none of them are required. that way you can easily send more then one view file to the template. Or none at all if you are just showing a message, etc. Also notice that we have $templatefolder - that way you can easily reuse the template file for other site templates, even with the same content.

in your controller (similar to tutorial) it would be

$data['content01'] = 'codeigniterrawks';
$data['content02'] = 'mypetlion';
// beta template
$this->load->view( 'template_beta', $data );
note how easy it is if i want to bring in those same view files into a different template

$data['content01'] = 'codeigniterrawks';
$data['content02'] = 'mypetlion';
// alpha template
$this->load->view( 'template_alpha', $data );
Reply


Messages In This Thread
RE: Integrating a Template with CodeIgniter 3 - by LansoirThemos - 11-08-2022, 12:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB