Welcome Guest, Not a member yet? Register   Sign In
A Newbie question
#1

[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


Messages In This Thread
A Newbie question - by El Forum - 08-11-2008, 08:00 AM
A Newbie question - by El Forum - 09-07-2008, 08:40 AM
A Newbie question - by El Forum - 09-07-2008, 09:01 AM
A Newbie question - by El Forum - 09-07-2008, 09:37 AM
A Newbie question - by El Forum - 09-07-2008, 09:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB