我收到错误Php Class not Found (Zend)
我的文件夹层次结构 :
/FFMobile(main Folder)
/Controller(Folder)
/Model(Folder)
/Tournament.php
/class1.php
/method1();
/class2.php
/method2();
我的动机是进入锦标赛中的 1 级和 2 级.php
自动取款机 我正在尝试通过以下方式访问它们
$data1 = /class1::method1();
$data2 = /class2::method2();
但我无法访问我收到错误消息的类"Class not Found".
你在锦标赛中需要这些课程吗.php ?
您可以使用 use
命令执行此操作。
此外,我建议不要使用 scope 运算符::
只调用 1 方法,我们通常在要调用 parent::method 时这样做。
你应该实例化 de class,然后调用该方法。
$class1 = new 'class1();
$data1 = $class1->method1();
$class2 = new 'class2();
$data2 = $class2->method2();
希望这对你有帮助