问题描述
|
森纳里奥
我有一个作为抽象类扩展的类。抽象类使用它们的方法加载我的文件和扩展名(抽象类的链接到pastebin)。
这在我的extends类中这样调用(缩短和简化-拼写错误仅在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} \”。
我想使用我的抽象类,但仍然能够将包含扩展名的类移动到单独的文件中。有什么办法吗?
提前致谢!
解决方法
在
load_file
功能中使用include_once
代替include
。