2016-02-29 56 views
1

嗨,我目前正在對我的hmvc文件的第二個模塊,並出現一個錯誤,我認爲它不會加載此模塊的模型。以前的模塊型號,工作正常。這可能是什麼錯誤?這是我的代碼。HMVC模型無法加載SAYS消息:未定義的屬性:

錯誤

Severity: Notice 

Message: Undefined property: CI::$lEmploymentStatus_Model 

Filename: MX/Controller.php 

Line Number: 59 

Backtrace: 

File: C:\xampp\htdocs\TLC_HR\application\third_party\MX\Controller.php 
Line: 59 
Function: _error_handler 

File: C:\xampp\htdocs\TLC_HR\application\modules\EmploymentStatus\Controllers\EmploymentStatus.php 
Line: 43 
Function: __get 

File: C:\xampp\htdocs\TLC_HR\index.php 
Line: 292 
Function: require_once 

控制器 - EmploymentStatus.php

<?php 

class EmploymentStatus extends MY_Controller{ 

    public function __construct(){ 

     parent::__construct(); 
    } 

// VIEW REDIRECTING ///////////////////////////////////////////////////////// 

    public function index(){ 

    $data['content_view'] = 'EmploymentStatus/empstat_read'; 
    $this->templates->admin_template($data); 

    } 

    public function add_view(){ 

    $data['content_view'] = 'EmploymentStatus/add_view'; 
    $this->templates->admin_template($data); 

    } 


// CREATE ///////////////////////////////////////////////////////// 

    public function create(){ 


     $this->load->library('form_validation'); 
     $this->load->model('EmploymentStatus_Model'); 

     $this->form_validation->set_rules('ES_NAME','Name','trim|required|min_length[2]|max_length[20]'); 
     $this->form_validation->set_rules('ES_DESCRIPTION','Description','trim|required|max_length[50]'); 

     if($this->form_validation->run() == FALSE){ 

      $this->add_view(); 
     }else{ 

      if($query = $this->lEmploymentStatus_Model->insert()){ 
       $this->add_view(); 
      }else{ 
       $this->add_view(); 
      } 

     } 

    } 

} 

?> 

模型 - EmploymentStatus_Model.php

<?php 

class EmploymentStatus_Model extends CI_Model{ 

///// CREATE ///////////////////////////////////////////////////////// 

    public function insert(){ 

     $input = array(
       'ES_NAME' => $this->input->post('ES_NAME'), 
       'ES_DESCRIPTION' => $this->input->post('ES_DESCRIPTION') 
       ); 
     $insert = $this->db->insert('employment_status',$input); 
     return $insert; 
    } 

} 

?> 

回答

0

它完美的罰款。它只是有一個錯字。

if($query = $this->lEmploymentStatus_Model->insert()){ $this->add_view();

lEmploymentStatus必須EmploymentStatus

相關問題