Hi Here is my Loader and Index Function inside my Controller
While calling the index() function I am assigning the $menu['menu'] and $menu['menu'] at the same time i am the value for $data and sending it to the loader function.
In the Loader function
I am calling the header (which has css,js files)
I am calling the view index and sending the value $data into it
I am calling the footer
But in the index view even i didn't send the value $menu, i am able to print the $menu and $title but i can't able to print the $data.
What is the mistake i am doing. How can i get the value of $data inside the index view
Here is my Code :
public function loader($url,$menu,$data)
{
$this->load->view('assets/header',$menu);
$this->load->view($url,$menu,$data);
$this->load->view('assets/footer');
}
public function index()
{
$menu['menu']="home";
$menu['title']="Home Page";
$data='somedata';
$this->loader('index',$menu,$data);
}