• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
First CI site -> Question regarding controllers for pages

#2
[eluser]crumpet[/eluser]
you can call views from within views
so you can have a view file called "loader.php" which calls hte header, and then the nav, and then the content and then the footer etc...
i usually make a function in my controller like this
Code:
function _run($view){
$this->template['module'] = $view;
$this->load->view('loader');
}
Code:
//loader.php
$this->load->view('header');
$this->load->view('nav');
$this->load->view($module);
$this->load->view('footer');

Then the functions in my controller don't call $this->load->view() instead tehy call $this->_run()


Messages In This Thread
First CI site -> Question regarding controllers for pages - by El Forum - 10-10-2008, 07:01 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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