|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2013-12-9 11:26:25
|
显示全部楼层
若测试不成功。这里重新说明一下。third_party下的类名不能与controller下类名一制。
1:在 application/third_party新建libraries文件夹,在libraries目录下建一个mytest.php
<?php
class mytest{
function getval(){ return 110;}
}
?>
2:在application/controllers 下新建一个:test.php
<?php
class test extends CI_Controller{
function __construct(){
parent::__construct();
}
function index(){
$this->load->add_package_path("application/third_path/");
$this->load->library("mytest",'','myt');
echo $this->myt->getval();
}
}
?> |
|