• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.