Can someone help me out with this piece of code.
I have a template set up like this:
system/core/Loader.php :
public function template($view, $vars = array(), $return = FALSE)
{
$template = $this->view('includes/header', array(), $return);
$template = $this->view('includes/navigation', array(), $return);
$template .= $this->view($view, $vars, $return);
$template .= $this->view('includes/footer', array(), $return);
if ($return)
{
return $template;
}
}
It works perfect but when I try this to display a dynamic title, it doesn't want to display the title. I guess because the data is passed to content_home rather then to includes/header:
my controller:
public function home() {
$this->load->model("model_get");
$data["page_title"] = "Home Page";
$data["results"] = ($this->model_get->getData("home"));
$this->load->template("content_home",$data);
}
includes/header.php
<title><?php echo (isset($page_title)) ? $page_title : 'Default title text'; ?> </title>
Any ideas how to work it out ??
Thanks : )