2014-09-17 2 views
0

Linux 컴퓨터에서 CodeIgniter의 로컬 복사본과 다른 복사본을 설정했습니다. 내 응용 프로그램과 함께 두 복사본을 설치 한 후, 로컬 복사본은 잘 실행되지만 리눅스 버전은 다음 오류 코드를 보여주고있다 :Codeigniter (모델 관련 문제)와 관련된 이상한 문제

Unable to locate the model you have specified: User_model 

나는이에 대한 답에 대한 모든 일을 검색했다. 나는 모델명, 파일 이름, 내가 생각할 수있는 모든 것의 철자를 바꾸려고 노력했다. 내가 그 오류를 표시하는 것이 무엇이 실종 될 수 있습니까?

(user_model.php)

<?php 

class User_model extends CI_Model { 
    public function __construct(){ 
     parent::__construct(); 
    } 

    function runTest(){ 
     return "Testing"; 
    } 
} 
?> 

(welcome.php)

class Welcome extends CI_Controller { 
public function __construct(){ 
    parent::__construct(); 
} 
public function index() 
{ 
    $this->load->model('User_Model'); 
    $data['testing'] = $this->user1234->runTest(); 
    $this->load->view('welcome_message', $data); 
} 

}

+0

로 변경 두 번째 줄에있다. co.kr/a/8077427/4031969? – marian0

답변

0
:

고마워

여기

내 코드의 복사본입니다

그것은 b 대소 문자 구분. 우선 모든 파일 이름을 작은 글자 (user_model.php)로 유지하고 컨트롤러 ($ this-> load-> model ('user_model');)에서 해당 이름을 사용해야합니다.

작동해야합니다.

0

모든 도움을 주셔서 감사합니다. 분명히 명명 문제였습니다. 파일 이름을 대문자로 바꿨고 컨트롤러에서 이제는 정상적으로 작동합니다. 그게 무슨 조용한 일인지 모르겠다. 하지만 고맙습니다.

새로운 코드는 다음과 같습니다 : // 유래 :

$this->load->model('User_model'); 
$query = $this->User_model->validate(); 
0
 $this->load->model('User_Model'); 
    $data['testing'] = $this->user1234->runTest(); 
    $this->load->view('welcome_message', $data); 

오류가 당신이 게시물에 http 볼 수

$data['testing'] = $this->user_model->runTest(); 
관련 문제