问题描述
(我正在使用Joomla v1.5.15和PHP 5.3.4)
(I'm using Joomla v1.5.15 and PHP 5.3.4)
我已经测试了在这个和其他开发者论坛中找到的解决方案,但我仍然有相同的错误。
I have tested the solutions found in this and others developer forums, but I still having the same error.
要求file => contratolocal.php
Requiring file => contratolocal.php
...
if ( !class_exists('MTIHelperEstadosLocal') )
JLoader::import('helpers.estados.estadoslocal', JPATH_COMPONENT, false);
class MTIControllerContratoLocal extends MTIController
{
...
必需文件=> estadoslocal.php
Required file => estadoslocal.php
...
class MTIHelperEstadosLocal extends MTIHelperEstados
{
...
JLoader :: import在Joomla中通常用于导入文件到实际的脚本。无论如何,我尝试了include / require_oncephp方法也没有成功。
"JLoader::import" is used normally in Joomla to import files to the actual script. Anyway, I tried "include/require_once" php methods also without success.
我在尝试的每个解决方案中都遇到了同样的错误:
I got the same error with every solution that I tried:
这个类之前没有声明因为我不能使用没有导入的类,如果我打印返回的get_declared_classes()php方法的数组,这个类不是那里。
The class is not declarated previously becouse I can't use the class without the import and if I print the returned array of the "get_declared_classes()" php method, this class isn't there.
发生了什么?
谢谢
推荐答案
解决。
有2个问题:
- 在我的项目中有一些帮助器包含其他文件,其中一个先前已经完成了require_once。
-
require_once不能避免第二个包含,我必须在条件中编码每个require_once:
- In my project there are some helpers that include other files, and one of them has a require_once previously done.
The require_once doesn't avoid the second include, and I had to code every require_once in a condition:
这篇关于“致命错误:无法重新声明课程” ......但是没有宣布上课的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!