Welcome Guest, Not a member yet? Register   Sign In
Loading default views
#1

[eluser]kezman[/eluser]
Hey everyone!
I have 10 controllers in my codeigniter web application.
I want to load header.php and footer.php views by default, but only in 8 cases.
Other 2 cases i want to load no view.

How can I do it?
Add

Code:
if($load_templates === TRUE)
{
   $this->load->view('header');
   $this->load->view('footer');
}

this code to
Code:
CI_Controller
constructor, and then call
Code:
parent::__construct($load_templates);
?
#2

[eluser]skunkbad[/eluser]
You could always use nested views. I have a main template that you embed other views in.
#3

[eluser]kezman[/eluser]
skunkbad, thanks. problem solved.




Theme © iAndrew 2016 - Forum software by © MyBB