Fatal error: Class NAME not found in (…PATH)?

跟風遠走 提交于 2019-12-12 05:18:15

问题


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

while i am extending a class i got this error

example:

class ModuleUser extends AbstractModule

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

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

any help will be thankful

thanks n advance

Fero


回答1:


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

require_once 'path/to/abstract_module.php';

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



来源:https://stackoverflow.com/questions/1678989/fatal-error-class-name-not-found-in-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!