CodeIgniter Forums
Would be a fault of Xampp? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Would be a fault of Xampp? (/showthread.php?tid=33870)



Would be a fault of Xampp? - El Forum - 09-11-2010

[eluser]RedHazor[/eluser]
Good morning,

I am newbie in CodeIgniter and I cant complete the basic tutorial =(

The trouble is the message of error:

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: heading
Filename: views/blogview.php
Line Number: 6


The codes are copied from "Adding Dynamic Data to View" in http://ellislab.com/codeigniter/user-guide/general/views.html

Here is my code:

controllers/blog.php

<?php
class Blog extends Controller{
function index()
{
$data['title'] = "My Real Title";
$data['heading'] = "My Real Heading";

$this->load->view('blogview');
}

function comments()
{
echo 'Look at this!';
}
}
?>

views/blogview.php

<?php
class Blog extends Controller{
function index()
{
$data['title'] = "My Real Title";
$data['heading'] = "My Real Heading";

$this->load->view('blogview');
}

function comments()
{
echo 'Look at this!';
}
}
?>

I am using:

Windows 7 64-bit
Xampp 1.7.3
PHP 5.3.1

Someone have experience with this trouble?
Many thanks in advance and sorry for my bad english.


Would be a fault of Xampp? - El Forum - 09-11-2010

[eluser]RedHazor[/eluser]
This post dont help me...
http://ellislab.com/forums/viewthread/71468/P0/


Would be a fault of Xampp? - El Forum - 09-11-2010

[eluser]RedHazor[/eluser]
I found the mistake...

I dont put $data in this line:

$this->load->view('blogview', $data);

Duh! Newbie stuff