致命错误:在 (....PATH) 中找不到类 NAME? [英] Fatal error: Class NAME not found in (....PATH)?

查看:29
本文介绍了致命错误:在 (....PATH) 中找不到类 NAME?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果出现以下错误,可能是什么问题.

What may be the problem if i get the following error.

当我扩展一个类时,我遇到了这个错误

while i am extending a class i got this error

示例:

类 ModuleUser 扩展抽象模块

class ModuleUser extends AbstractModule

致命错误:在 (..PATH) 中找不到类 AbstractModule ?

Fatal error: Class AbstractModule not found in (....PATH) ?

我已经完成了大部分的可能性......但我无法解决问题.

I have done most of the possibilities... But i can't resolve the problem.

任何帮助将不胜感激

提前感谢

费罗

推荐答案

在定义 ModuleUser 之前,导入包含 AbstractModule 定义的文件.

Prior to your definition of ModuleUser, import the file that contains the definition for AbstractModule.

require_once 'path/to/abstract_module.php';

如果两个类都在同一个文件中,那么请确保在定义 AbstractModule 之后定义类 ModuleUser.

If both classes are in the same file, then make sure you define the class ModuleUser after you define AbstractModule.

这篇关于致命错误:在 (....PATH) 中找不到类 NAME?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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