Codeigniter无法重新声明类层次结构 [英] Codeigniter Cannot redeclare class Hierarchy

查看:71
本文介绍了Codeigniter无法重新声明类层次结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Codeigniter中的某些层次结构类有一些问题。我在控制器上具有3级层次结构:

I have some problems with some Hierarchy classes in Codeigniter. I have a 3 level hierarchy on controller:

class Application_controller extends CI_Controller

另一个

class Newsletter extends Application_controller

和第三个:

class Groups extends Newsletter

我在类中定义了一些常量,以便进行配置代码更简洁,更易于与其他模型集成。

I have some constants defined in the classes for configuration to make the code more clean and easy to integrate with other models.

问题是当我尝试访问菜单以制作时事通讯并将其发送给某些客户时,我尝试为此:

The problem is when i try to access the menu to make a newsletter and send it to some clients i try to do this:

function createNewsletter(){
Groups::TABLE;
}

在该变量中,我具有用于从数据库获取组的表名。 Buit让我一直显示此错误:

in that variable i have the table name to get the groups from database. Buit keeps me showing this error:


无法重新声明类

Cannot redeclare class

我像往常一样在Class中有require_once,但它使我一直显示该错误。
您能帮我吗?

I have the require_once in the Classes like usual but it keeps me showing that error. Can you help me?

预先感谢

Elkas

推荐答案

问题已解决。

我只是傻瓜。我在需求的无限循环中。

I've just being dumb. I was on a infinit loop on the requires.

示例:

在其中需要 main.php子类,在主类中,我需要 subclass.php,显然这给了我一个错误。

require "main.php" in the subclass and in the main class i require "subclass.php", obviously it gives me an error.

这篇关于Codeigniter无法重新声明类层次结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆