[eluser]CI Newbie Guru[/eluser]
Hi,
I have recently installed codeigniter but having few issues. I have searched the forum and have viewed video tutorial but cannot find what is wrong with my code/settings.
1) I have home.php controller in home folder under controllers (controllers->home->home.php). I have changed the default controller in routes.php to home/home but i get 404 error. If i copy the home.php controller directly under controllers folder and change it to 'home' in routes then it works fine. Can you please tell me what to do to make it use home/home controller.
2) In my home controller i get following error
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: data
Filename: controllers/home.php
Line Number: 13
This is the code from home.php
Code:
<?php
class Home extends Controller {
function Home()
{
parent::Controller();
}
function index()
{
$data ['header'] = $this->load->view('common/header', $data, TRUE);
$this->load->view('homepage', $data);
}
}
?>
It loads the header view fine and display the content of data['header'] on homepage view without any problems.
Can any one please tell me where i am going wrong.
Thanks