Welcome Guest, Not a member yet? Register   Sign In
$data is undefined - example followed from video tutorial
#1

[eluser]deco10[/eluser]
So I suppose I must have done something in terms of configuration to cause this because it doesn't any sense otherwise.

$data is undefined when I go to the prod page. index.php/prod
The home page loads just fine.

this is in my prod_view.php file (in views, obviously)

Code:
<title><?=$data['title']?></title>


this is my controller:

Code:
class Home extends Controller {

    function Home()
    {
        parent::Controller();
    $this->load->helper('url');
    $this->load->helper('html');    
    }
    
    function prod()
    {
        $data['title'] = "Auto - Product Line";

        $this->load->view('prod_view', $data);
    }
    
    
    function index()
    {
        $data['title'] = "Auto - Home";
        $this->load->view('home_view', $data);
    }
}


Messages In This Thread
$data is undefined - example followed from video tutorial - by El Forum - 06-05-2009, 08:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB