Integrating a Template with CodeIgniter 3 |
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 ); |
Messages In This Thread |
Integrating a Template with CodeIgniter 3 - by KamaalJema - 11-04-2022, 12:44 AM
RE: Integrating a Template with CodeIgniter 3 - by InsiteFX - 11-05-2022, 12:27 AM
RE: Integrating a Template with CodeIgniter 3 - by JustJohnQ - 11-05-2022, 02:33 AM
RE: Integrating a Template with CodeIgniter 3 - by LansoirThemos - 11-08-2022, 12:45 AM
|