skip to Main Content

An uncaught Exception was encountered

Type: RuntimeException

Message: Unable to locate the model you have specified: Impact_model

Filename:
/home/appliedi/public_html/multisector.Nutrition.com/system/core/Loader.php

Line Number: 344

Backtrace:

File:
/home/appliedi/public_html/multisector.Nutrition.com/application/third_party/MX/Loader.php
Line: 213 Function: model

File:
/home/appliedi/public_html/multisector.Nutrition.com/application/modules/Ministry/controllers/Ministry.php
Line: 11 Function: model

File: /home/appliedi/public_html/multisector.Nutrition.com/index.php
Line: 315 Function: require_once //error at this line on controller

<?php
class Ministry extends MX_Controller
{
    function __construct()
    {
        parent::__construct();
        $this->load->model('Ministry_model');
        //error i think cant call external controller model
        $this->load->model('Impact/Impact_model');
        //---------------------------------
        $sad = $this->session->all_userdata();
        if(!$sad['checkLogin'] == true)
        {
          redirect( base_url('login') );
        }
    }
 }

3

Answers


  1. <?php
    class Ministry extends MX_Controller
    {
      function index()
      {
         $this->load->model('Ministry_model');
         $this->load->model('Impact/Impact_model');
         $sad = $this->session->all_userdata();
         if(!$sad['checkLogin'] == true)
         {
             redirect( base_url('login') );
         }
      }
    }
    
    Login or Signup to reply.
  2. make sure all model filename & class name are in capital letters..linux is case sensitive unlike windows ..

    Login or Signup to reply.
  3. On serveryou should follow tha name pattern as:

    For Model:

    Filename:
    mymodel.php

    In File:

    class Mymodel extends CI_Model{
        //code
    }
    

    For Controller:

    Filename:
    Mycontroller.php

    In File:

    class Mycontroller extends CI_Controller{
        //code
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search