2011-08-06 3 views
0

이전 질문에 따라 나는 codeigniter에 대한 HMVC 확장을 설정하고 있습니다. https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home 불행히도 나는 문서의 방법으로 많이 찾을 수 없습니다.CodeIgniter HMVC 설정

내 폴더를 설정하는 방법에 대해 혼란스러워합니다. third_party의 MX 폴더와 코어 폴더의 파일을 복사했습니다. 그 후 application/modules 폴더를 만들었습니다. 거기에서 배너 슬라이더 위젯을 만들고 싶습니다. 나는 '컨트롤러', '모델'및 '뷰'폴더가있는 '슬라이더'라는 모듈에 하위 폴더를 만들었습니다. 내 응용 프로그램/모듈/슬라이더/컨트롤러/폴더 안에 main.php라는 컨트롤러가 있습니다. 내 응용 프로그램/모듈/슬라이더/모델/폴더 안에는 slider_model.php라는 모델이 있습니다. 첫째, 이것을 사용하기위한 적절한 폴더 구조입니까? 그렇다면 여기에 내가 가지고있는 문제가 있습니다. 사이트를로드

내 welcome.php 컨트롤러는 다음과 같습니다 다음 welcome_message.php의 내부보기

<?php if (! defined('BASEPATH')) exit('No direct script access allowed'); 

class Welcome extends CI_Controller { 

/** 
* Index Page for this controller. 
* 
* Maps to the following URL 
*  http://example.com/index.php/welcome 
* - or - 
*  http://example.com/index.php/welcome/index 
* - or - 
* Since this controller is set as the default controller in 
* config/routes.php, it's displayed at http://example.com/ 
* 
* So any other public methods not prefixed with an underscore will 
* map to /index.php/welcome/<method_name> 
* @see http://codeigniter.com/user_guide/general/urls.html 
*/ 
public function index() 
{ 
    $this->load->view('header'); 
    $this->load->view('welcome_message'); 
    $this->load->view('footer'); 
} 
} 

/* End of file welcome.php */ 
/* Location: ./application/controllers/welcome.php */ 

나는 다음과 같은 한 :

<? echo Modules::run("slider/main/getcontent/"); ?> 

그럼,이 메인 컨트롤러 내부 이 :

<?php 
class Main extends MX_Controller{ 
function __construct(){ 
    parent::__construct(); 
    $this->load->model('slider/Slider_model','Slider'); 
} 

function getcontent(){ 
    // 
    //echo $this->Slider->test_conn(); 
    echo "Testing..."; 
} 
} 

?> 

나는이 오류가 발생합니다. 치명적인 오류 : Can not r edeclare class CI in /homepages/15/d94236848/htdocs/application/third_party/MX/Base.php on line 57

무엇이 누락 되었습니까?

+0

알아 냈습니다. welcome.php 컨트롤러에서 CI_Controller 대신 MX_Controller를 확장하도록 변경해야했습니다. welcome_message.php의 모듈 호출에 대한 마지막 슬래쉬도 제거해야했습니다. – LoneWolfPR

+1

이 질문에 답변 한 경우 답변으로 추가 한 다음 질문에 답변으로 표시하십시오. – cwallenpoole

답변

1

위의 의견대로 답변으로 내 의견을 다시 게시합니다.

알아 냈어. welcome.php 컨트롤러에서 CI_Controller 대신 MX_Controller를 확장하도록 변경해야했습니다. welcome_message.php의 모듈 호출에 대한 마지막 슬래쉬도 제거해야했습니다.

관련 문제