Welcome Guest, Not a member yet? Register   Sign In
loading template only once ?
#1

Hello to the nice community !

I'm a beginner in CI (but not in PHP), i saw the CI logic is to load the template files in the controller in each method. 
At the end you load the same files all the time, and it makes heavy controller files for nothing. 

Code:
$this->load->view('templates/header', $data);
$this->load->view('news/create');
$this->load->view('templates/footer');

There is an easier solution to just load it once in your controller or even in your project (for example if you use the same template for the whole project ? 
Or maybe just to have one template.php file and loading the content inside ? 

If you can help me, you will be lovely ! 
Thanks a lot Smile
Reply


Messages In This Thread
loading template only once ? - by Coool6 - 02-22-2017, 07:22 AM
RE: loading template only once ? - by InsiteFX - 02-22-2017, 11:10 AM
RE: loading template only once ? - by Coool6 - 02-22-2017, 12:10 PM
RE: loading template only once ? - by ciadmin - 02-22-2017, 10:06 PM
RE: loading template only once ? - by InsiteFX - 02-23-2017, 05:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB