我想問一下,如果在codeigniter中擴展控制器的正確方法是什麼。因爲現在我遇到Fatal error: Class 'ApiController' not found in
這兩個文件都駐留在同一目錄api
文件夾中。這裏是我的代碼:在Codeigniter 2.0中擴展控制器
<?php
//EchelonApiController.php
class EchelonApiController extends ApiController {
public function __construct() {
parent::__construct();
}
public function index(){
echo 'asd';
}
}
<?php
// ApiController.php
class ApiController extends CI_Controller {
public $table;
public function __construct(){
parent::__construct();
$this->load->models("api/".$table);
}
public function index(){
}
}