Would be a fault of Xampp? |
[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-gui...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.
[eluser]RedHazor[/eluser]
I found the mistake... I dont put $data in this line: $this->load->view('blogview', $data); Duh! Newbie stuff |
Welcome Guest, Not a member yet? Register Sign In |