如何在ZF3中初始化模块(用户)?

问题描述 投票:-1回答:1

我试图在ZendFramework3 localhost中运行Hello world但是遇到问题..

/ Documents / zen / path / to / install $ php -S 0.0.0.0:8000 -t public public / index.php

PHP 7.2.17-1 + ubuntu18.04.1 + deb.sury.org + 3开发服务器于4月25日星期四17:15:10开始听http://0.0.0.0:8000

/home/Documents/zen/path/to/install/vendor/zendframework/zend-modulemanager/src/ModuleManager.php:203
Stack trace:
#0 /home/Documents/zen/path/to/install/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(175): Zend\ModuleManager\ModuleManager->loadModuleByName(Object(Zend\ModuleManager\ModuleEvent))

#1 /home/Documents/zen/path/to/install/vendor/zendframework/zend-modulemanager/src/ModuleManager.php(97): Zend\ModuleManager\ModuleManager->loadModule('User')

#2 /home/Documents/zen/path/to/install/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\ModuleManager\ModuleManager->onLoadModules(Object(Zend\ModuleManager\ModuleEvent))

#3 /home/Documents/zen/path/to/install/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners(Object(Zend\ModuleManager\ModuleEvent))

#4 /home/ in /home/Documents/zen/path/to/install/vendor/zendframework/zend-modulemanager/src/ModuleManager.php on line 203

请帮我。

谢谢。

zend-framework3
1个回答
1
投票

如果添加模块(用户),则必须:

  • config/modules.config.php中添加模块命名空间
  • composer.json中添加模块命名空间和路径,部分autoload/psr-4(路径必须以“/”结尾)
  • 运行composer dump-autoload来更新你的vendor / composer / ...文件
© www.soinside.com 2019 - 2024. All rights reserved.