Welcome Guest, Not a member yet? Register   Sign In
php Include, what is the right approach in Code Igniter?
#1

[eluser]0plus1[/eluser]
I have some common files in my project like footer.php, menu.php etc..
Normally I would include them like so:

Code:
include 'footer.php';

What is the best practice to do this in CI?
#2

[eluser]Dam1an[/eluser]
Assuming your refering to just view files, such as header, menu, footer, then you put each on into a php file in the view folder, you can then call them using
Code:
$this->load->view('header');

You can either call each part seperatly, or create a master view file, which then calls the sub views

Make sense?




Theme © iAndrew 2016 - Forum software by © MyBB