title: How to load the custom Model in Opencart
body: <p>I have created the one custom Module in Opencart.</p>
  
  <p>The details of that:</p>
  
  <p><strong>Controller</strong>: file named block.php in admin/controller/custom/block.php</p>
  
  <p><strong>View</strong>  : file named block.tpl in admin/view/template/custom/block.tpl</p>
  
  <p><strong>Model</strong> : file named block.php in admin/model/custom/block.php</p>
  
  <p>I have successfully configured permissions.</p>
  
  <p><img src="https://i.stack.imgur.com/ZFAz8.png" alt="enter image description here"></p>
  
  <p>When I load this model in Controller means, I got the following error..</p>
  
  <pre><code>Fatal error: Call to a member function load() on a non-object in F:\xampp\htdocs\shirtrecipe\admin\controller\custom\block.php on line 11
  </code></pre>
  
  <p><strong>Controller Code:</strong></p>
  
  <pre><code>&lt;?php
  
  class ControllerCustomBlock extends Controller
  {
  public function index() {
  
  
      $this-&gt;language-&gt;load('custom/block');
  
      $this-&gt;model-&gt;load('custom/block'); /* doesnt load this model */
  
      $this-&gt;data['breadcrumbs'] = array();
              ...
              ...
  </code></pre>
  
  <p><strong>Model Code:</strong></p>
  
  <pre><code>&lt;?php
  
  class ModelCustomBlock extends Model
  {
  
  public function get_demo_block() {
  
      $sql = "select demo_block_img from oc_block where id=1";
      $query = $this-&gt;db-&gt;query($sql);
  
      return $query-&gt;row;
  
  }
  
  
  }
  </code></pre>