이 문제를 해결하기 위해, 일반적으로 대부분의 사람들은 내가 그들이 거의 자신의 클래스에 의해 참조되지 않습니다 때문에, 대신 컨트롤러에 접미어를 추가하는 것이 좋습니다 생각
모델 클래스 이름에 '_model'접미사를 추가 코드의 이름.
먼저 라우터 클래스를 확장해야합니다. "응용 프로그램/라이브러리/MY_Router.php"
class MY_Router extends CI_Router {
var $suffix = '_controller';
function __construct() {
parent::CI_Router();
}
function set_class($class) {
$this->class = $class . $this->suffix;
}
function controller_name() {
if (strstr($this->class, $this->suffix)) {
return str_replace($this->suffix, '', $this->class);
}
else {
return $this->class;
}
}
}
이제 편집 "시스템/CodeIgniter의/CodeIgniter.php"
라인 (153) :
if (! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->controller_name().EXT))
라인
이 파일을 만듭니다 158 :
include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->controller_name().EXT);
다음, 편집 : "시스템/라이브러리/Profiler.php", 323 :
$output .= "
<div style="color:#995300;font-weight:normal;padding:4px 0 4px 0">".$this->CI->router->controller_name()."/".$this->CI->router->fetch_method()."</div>";
Source
이 때문에 PHP5.3 [네임 스페이스] (http://php.net/manual/en/language.namespaces.php)로 작업 할 수있는 프레임 워크를 찾아야합니다. 그 프레임 워크를 싫어하는만큼, FuelPHP가 당신을위한 논리적 인 단계 일 수 있습니다. 그 아주 새로운 CI 포크. 물론, 프레임 워크가 사용되거나 프레임 워크가 가능할 때까지 제어 할 수 있다면 그렇습니다. 그렇지 않다면 다음 프로젝트를 선택할 때 고려하십시오. –
FuelPHP에서 어디서 아이디어를 얻을 수 있는지 모르겠다. CI 포크입니다. 그것은 처음부터 만들어졌으며 CI와 공통점이 없으며 호환되지 않습니다. – WanWizard