Zend framework2 ZF2:Zend Framework 2.3.0:致命错误:找不到类IndexController

Zend framework2 ZF2:Zend Framework 2.3.0:致命错误:找不到类IndexController,zend-framework2,Zend Framework2,我正在通过构建一个教程应用程序来研究Zend框架。 我已经检查了我的代码几次,并将其与源代码进行了比较 这本书的作者 我想不出一个解决办法或解释为什么 这个错误一直在发生。有人能帮我吗 Fatal error: Class 'Wall\Controller\IndexController' not found in C:\xampp\htdocs\Connect\client\vendor\zendframework\zendframework\library\Zend\ServiceManag

我正在通过构建一个教程应用程序来研究Zend框架。 我已经检查了我的代码几次,并将其与源代码进行了比较 这本书的作者

我想不出一个解决办法或解释为什么 这个错误一直在发生。有人能帮我吗

Fatal error: Class 'Wall\Controller\IndexController' not found in C:\xampp\htdocs\Connect\client\vendor\zendframework\zendframework\library\Zend\ServiceManager\AbstractPluginManager.php on line 170

Call Stack
#   Time    Memory  Function

1   0.0010  138824  {main}( )   ..\index.php:0
2   0.1250  4071920 Zend\Mvc\Application->run( )    ..\index.php:12
3   0.1260  4090064 Zend\EventManager\EventManager->trigger( )  ..\Application.php:316
4   0.1260  4090072 Zend\EventManager\EventManager->triggerListeners( ) ..\EventManager.php:207
5   0.1270  4091280 call_user_func ( )  ..\EventManager.php:468
6   0.1270  4091568 Zend\Mvc\DispatchListener->onDispatch( )    ..\EventManager.php:468
7   0.1270  4091752 Zend\Mvc\Controller\ControllerManager->get( )   ..\DispatchListener.php:97
8   0.1270  4091936 Zend\ServiceManager\AbstractPluginManager->get( )   ..\ControllerManager.php:137
9   0.1270  4091904 Zend\ServiceManager\ServiceManager->get( )  ..\AbstractPluginManager.php:103
10  0.1270  4092584 Zend\ServiceManager\ServiceManager->create( )   ..\ServiceManager.php:504
11  0.1270  4092728 Zend\ServiceManager\ServiceManager->doCreate( ) ..\ServiceManager.php:572
12  0.1270  4092816 Zend\ServiceManager\AbstractPluginManager->createFromInvokable( )   ..\ServiceManager.php:616
module.config.php

return array(
    'router' => array(
        'routes' => array(
            'wall' => array(
                'type' => 'Zend\Mvc\Router\Http\Segment',
                'options' => array(
                    'route' => '/:username',
                    'constraints' => array(
                        'username' => '\w+'
                    ),
                    'defaults' => array(
                        'controller' => 'Wall\Controller\Index',
                        'action'     => 'index',
                    ),
                ),
            ),
        ),
    ),
    'controllers' => array(
        'invokables' => array(
            'Wall\Controller\Index' => 'Wall\Controller\IndexController',
        ),
    ),
    'view_manager' => array(
        'template_path_stack' => array(
            __DIR__ . '/../view',
        ),
    ),
);
module.php

namespace Wall;

use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;

class Module
{
    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }

    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' , __NAMESPACE__
                ),
            ),
        );
    }
}
IndexController.php

namespace Wall\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\Stdlib\Hydrator\ClassMethods;
use Users\Entity\User;
use Api\Client\ApiClient as ApiClient;

class IndexController extends AbstractActionController
{
    public function indexAction()
    {
        $viewData = array();

        $username = $this->params()->fromRoute('username');
        $this->layout()->username = $username;

        $response = ApiClient::getWall($username);

        if ($response !== FALSE) {
            $hydrator = new ClassMethods();

            $user = $hydrator->hydrate($response, new User());
        } else {
            $this->getResponse()->setStatusCode(404);
            return;
        }

        $viewData['profileData'] = $user;

        return $viewData;
    }
}

在自动加载配置中很可能发生此错误

public function getAutoloaderConfig()
{
    return array(
        'Zend\Loader\StandardAutoloader' => array(
            'namespaces' => array(
                __NAMESPACE__ => __DIR__ . '/src/' , __NAMESPACE__
                                                // ^-- that should be a DOT .
            ),
        ),
    );
}

配置缓存启用?这可能已经完成了,只是休息一下,现在它的工作方式应该是这样的。