Codeigniter: Call to a member function view() on null
<p>I just started a simple php project by using codeigniter framework and my steps are following.</p>

<ol>
<li><p>Create a controller named <code>user.php</code>.</p></li>
<li><p>After that created a view <code>articles_list.php</code> inside the sub directory <code>public</code>.</p></li>
<li><p>After that loaded view in controller.</p></li>
</ol>

<p>but getting fatal error call to a member function view() on null.
for this i am using 3.2.1 version of codeigniter framework.</p>

<p>I am beginner in this framework.Please tell me where I am wrong.</p>

<p><strong>user.php (Controller)</strong></p>

<pre><code>&lt;?php
class User extends MY_Controller{
public function __construct() {        
parent::__construct();
}
public function index(){
    echo "list articles";
    $this-&gt;load-&gt;view('public/articles_list');
}
}
?&gt; 
</code></pre>

<p><strong>articles_list.php (View)</strong> </p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Article List&lt;/title&gt;
&lt;!--&lt;link rel="stylesheet" type="text/css" href="http://localhost/codeigniter/assets/css/bootstrap.min.css"&gt;--&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;hello&lt;/p&gt;
&lt;/body&gt;

&lt;/html&gt;
</code></pre>

<p>Thanks in advance.</p>

<p>Error like this..</p>

<p>list articles
A PHP Error was encountered</p>

<pre><code>Severity: Notice

Message: Undefined property: User::$load

Filename: controllers/user.php

Line Number: 8

Backtrace:

File: C:\xampp\htdocs\codeigniter\application\controllers\user.php
Line: 8
Function: _error_handler

File: C:\xampp\htdocs\codeigniter\index.php
Line: 315
Function: require_once


Fatal error: Call to a member function view() on null in C:\xampp\htdocs\codeigniter\application\controllers\user.php on line 8
A PHP Error was encountered

Severity: Error

Message: Call to a member function view() on null

Filename: controllers/user.php

Line Number: 8

Backtrace:
</code></pre>