我有一个类作为抽象类的扩展。抽象类加载我的文件&使用方法(link to pastebin for abstract class)进行扩展。
这在我的扩展类中被调用(缩短和简化 - 拼写错误仅在Q代码处):
class Pagination extends Pagination_Base
{
function __construct()
{
// loads the file "first.class.php" in the abstract class
parent::load_file( 'first' );
// stores the class as object in the abstract class, so we can access the methods and properties
parent::load_extension( new oxoFirst() );
}
}
现在我收到错误“无法重新声明课程{$ classname}”。
我想使用我的抽象类,但仍然能够将包含扩展的类移动到单独的文件中。有没有办法做到这一点?
提前致谢!
答案 0 :(得分:2)
在include_once
函数中使用include
代替load_file
。