前の質問に従って、codeigniter の HMVC 拡張機能をセットアップしています。 https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home 残念ながら、ドキュメントがあまり見つかりません。
フォルダの設定方法がわかりません。コア フォルダー内のファイルだけでなく、third_party 内の MX フォルダーもコピーしました。その後、application/modules フォルダーを作成しました。そこから、バナー スライダー ウィジェットを作成します。モジュール内に「スライダー」というサブフォルダーを作成し、その中に「コントローラー」、「モデル」、および「ビュー」フォルダーを作成しました。application/modules/slider/controllers/ フォルダー内に、main.php というコントローラーがあります。application/modules/slider/models/ フォルダー内に、slider_model.php というモデルがあります。まず、これはこれを使用するための適切なフォルダー構造ですか? もしそうなら、ここに私が抱えている問題があります。
サイトをロードするwelcome.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 */
welcome_message.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...";
}
}
?>
現状では、次のエラーが発生しています: Fatal error: Cannot redeclare class CI in /homepages/15/d94236848/htdocs/application/third_party/MX/Base.php on line 57
私は何が欠けていますか?