Welcome Guest, Not a member yet? Register   Sign In
How to Add Dynamic Header and Footer
#2

I solved this problem with MY_Controller.php in folder app/core/ I created a method/action with this:

PHP Code:
//...
public function theme($file){
 
   $this->load->view('themes/default/templates/common/header'$data);
 
   $this->load->view('themes/default/templates/common/'.$file$data);
 
   $this->load->view('themes/default/templates/common/footer'$data);
}
//... 

in controller extends the MY_Controller and call view with
PHP Code:
$this->theme('home'); 


see more about MY_Controller here: https://www.codeigniter.com/user_guide/g...asses.html
Reply


Messages In This Thread
RE: How to Add Dynamic Header and Footer - by wallacesilva09 - 03-02-2018, 03:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB