heiseeyong 发表于 2016-3-23 14:39:37

ci类库怎么继承类库?

两个类库都是自定义的类库
在 ./application/libraries下新建了两个文件Father.php Son.php
然后让 son 继承father我先上代码:

Father.php代码:
<?php
class Father{

    public function edit(){
      echo 'father/edit';
    }
}
?>


Son.php
<?php
class Son extends Father{

    public function index() {
      echo 'son/index';
    }
}
?>


这样写继承,在调用的时候会出错。
我应该怎么写?

ford123 发表于 2017-3-24 17:29:16

为什么要类库继承?

52lin 发表于 2018-5-7 11:46:02

你怎么调用的?
页: [1]
查看完整版本: ci类库怎么继承类库?