我创建了一个包含类的文件夹。我正在尝试访问控制器中该文件夹中类的返回。
提前致谢
模型类GetUserPersonalData及其位于此处:
E:\wamp\www\ZendEbayApp\module\Application\src\Application\models
我的控制器位于此处:
E:\wamp\www\ZendEbayApp\module\Application\src\Application\Controller
后端用户管理控制器.php
<?php
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
class BackendUserAdministrationController extends AbstractActionController {
public function indexAction() {
$this->layout('layout/BackendAdministrationLayout');
}
public function AddAdditionalUserAcountsAction() {
$this->layout('layout/BackendAdministrationLayout');
$GetUserPersonalDataClassObject = new \Application\models\GetUserPersonalDataClass();
$theoutputarray = $GetUserPersonalDataClassObject->GetUserPersonalDatafunction();
echo $theoutputarray[1];
}
public function AddCompanyDetailAction() {
$this->layout('layout/BackendAdministrationLayout');
}
public function AddUserAccountAction() {
$this->layout('layout/BackendAdministrationLayout');
}
public function AddUserPersonalAction() {
$this->layout('layout/BackendAdministrationLayout');
}
public function AddUserPlanDetailAction() {
$this->layout('layout/BackendAdministrationLayout');
}
public function AddUserPreferencesAction() {
$this->layout('layout/BackendAdministrationLayout');
}
public function AddUserTransactionsAction() {
$this->layout('layout/BackendAdministrationLayout');
}
}
获取用户个人数据.php
<?php
class GetUserPersonalDataClass {
public function GetUserPersonalDatafunction() {
$GetUserPersonalDataArray = array();
$OpenedUserPersonalFile = fopen("E:/wamp/www/ZendEbayApp/data/usersinformation/userPersonal.txt", "r");
while (!feof($OpenedUserPersonalFile)) {
$OpenedUserPersonalFileSingleRow = fgets($OpenedUserPersonalFile);
array_push($GetUserPersonalDataArray, "$OpenedUserPersonalFileSingleRow");
}
fclose($OpenedUserPersonalFile);
return $GetUserPersonalDataArray;
}
}
$GetUserPersonalDataClassObject = new GetUserPersonalDataClass();
$theoutputarray = $GetUserPersonalDataClassObject->GetUserPersonalDatafunction();
echo $theoutputarray[1];
?>
当我使用 betbeans 调试 BackendUserAdministrationController.php 时,它还说:
E:\wamp\bin\php\php5.4.3\php.exe E:\wamp\www\ZendEbayApp\module\Application\src\Application\Controller\BackendUserAdministrationController.php
Fatal error: Class 'Application\Controller\AbstractActionController' not found in E:\wamp\www\ZendEbayApp\module\Application\src\Application\Controller\BackendUserAdministrationController.php on line 7
Call Stack:
0.0013 130104 1. {main}() E:\wamp\www\ZendEbayApp\module\Application\src\Application\Controller\BackendUserAdministrationController.php:0
PHP Fatal error: Class 'Application\Controller\AbstractActionController' not found in E:\wamp\www\ZendEbayApp\module\Application\src\Application\Controller\BackendUserAdministrationController.php on line 7
PHP Stack trace:
PHP 1. {main}() E:\wamp\www\ZendEbayApp\module\Application\src\Application\Controller\BackendUserAdministrationController.php:0
Done.