CodeIgniter Forums
I am a newbie in codeigniter. How to fix this error. - 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: I am a newbie in codeigniter. How to fix this error. (/showthread.php?tid=51716)



I am a newbie in codeigniter. How to fix this error. - El Forum - 05-14-2012

[eluser]Unknown[/eluser]
A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI_Loader::$view

Filename: controllers/blog.php

Line Number: 7

My blog.php (controller is)

<?php
class Blog extends CI_Controller{

public function index()
{

$this->home();

}

public function home(){
$this->load->view['homeview'];
}
}

?>

homeview.php

<!DOCTYPE html>
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;title&gt;Welcome to CodeIgniter&lt;/title&gt;
&lt;link rel="stylesheet" href="application/views/main.css" type="text/css"/&gt;
&lt;/head&gt;
&lt;body&gt;

<div id="big_wrapper">
<h1>Suresh KUMAR Mukhiya</h1>


&lt;/body&gt;
&lt;/html&gt;









I am a newbie in codeigniter. How to fix this error. - El Forum - 05-14-2012

[eluser]Chathuranga Tennakoon[/eluser]
the problem occurs because you have used square brackets instead of parentheses.
Code:
problem :   $this->load->view[‘homeview’]; // you have used square brackets

solution :    $this->load->view(‘homeview’); //user parentheses



I am a newbie in codeigniter. How to fix this error. - El Forum - 05-15-2012

[eluser]cideveloper[/eluser]
Chathuranga is correct.

also please use code blocks when posting code. Makes it a lot easier to read. Thanks


I am a newbie in codeigniter. How to fix this error. - El Forum - 05-15-2012

[eluser]InsiteFX[/eluser]
I had EllisLabs add the code tags to the top of New Topic, But they need to read...