extends 自已的 controller
<?php
class Comm_Controller extends CI_Controller
{
function __construct()
{
parent::__construct();
}
//其它方法
public function hello_world()
{
echo "Hello World";
}
}
//file under application/controllers
//file name comm.php
继承这个controller
<?php
include FCPATH.APPPATH.'controllers/comm.php';
class Myfirstcontroller extends Comm_Controller
{
public function index()
{
$this->hello_world();
}
}
感谢仿照你的我的include 相对路径引入成功了 。include FCPATH.APPPATH.'controllers/comm.php';
我很奇怪 为什么在控制器中 引入上一级的不能用 include"../comm.php'"?
页:
[1]