나는이 책에 대한 젠드 프레임 워크 3 스켈레톤 튜토리얼을 따라 가고 있습니다.젠드 프레임 워크 3 뼈대 두 모듈
먼저 응용 프로그램 모듈이 작동하여 zend 화면의 표준 환영을 보여줍니다.
앨범 모듈을 추가하면 모든 것이 잘되었습니다. 내 URL의/앨범으로 이동하면 앨범 섹션이 표시되므로 모두 좋습니다. 그러나 응용 프로그램 섹션으로 돌아가려면 url의 끝에서/앨범을 제거하면 다음 404 페이지가 나타납니다.
**A 404 error occurred**
Page not found.
The requested controller could not be mapped to an existing controller class.
Controller:
ApplicationController (resolves to invalid controller class or alias:
ApplicationController)
No Exception available
내 코드의 일부 섹션을 표시 하겠지만 분당 내가 어떤 파일로 인해이를 일으킬 수 있는지 확신 할 수 없습니다. 어떤 사람이이 문제의 원인이되는 설정 파일을 알려 주면 업로드 할 수 있습니다. 나는 그것이 경로 지정 중이라고 확신하지만 ZF1에서 오는 것은 약간의 머리 긁적 거림입니다.
누군가가 나를보고 도와 주거나 설명 할 수 있다면 매우 감사 할 것입니다.
업데이트 다음은 내 응용 프로그램 모듈의 module.config.php입니다.
<?php
/**
* @link http://github.com/zendframework/ZendAlbumApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application;
use Zend\Router\Http\Literal;
use Zend\Router\Http\Segment;
use Zend\ServiceManager\Factory\InvokableFactory;
return [
'router' => [
'routes' => [
'home' => [
'type' => Literal::class,
'options' => [
'route' => '/',
'defaults' => [
'controller' => \ApplicationController::class,
'action' => 'index',
],
],
],
'application' => [
'type' => Segment::class,
'options' => [
'route' => '/application[/:action]',
'defaults' => [
'controller' => Controller\IndexController::class,
'action' => 'index',
],
],
],
],
],
'controllers' => [
'factories' => [
Controller\IndexController::class => InvokableFactory::class,
],
],
'view_manager' => [
'display_not_found_reason' => true,
'display_exceptions' => true,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => [
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
'error/404' => __DIR__ . '/../view/error/404.phtml',
'error/index' => __DIR__ . '/../view/error/index.phtml',
],
'template_path_stack' => [
__DIR__ . '/../view',
],
],
];
?>
나는 그것이 골격 젠드 프레임 워크 시작 페이지를 표시 URL에/응용 프로그램과 함께/앨범을 대체 업데이트 2. 나는이 페이지가 단지 http://localhost과 함께 나타날 것이라고 생각했다. 요점을 놓치고 있습니까? 아니면 응용 프로그램 모듈을 기본 모듈로 만들어 URL의 끝에 응용 프로그램을 추가 할 필요가 없습니까?
모듈/응용 프로그램/config.php를 표시 할 수 있습니까 –
내 원래 게시물을 업데이트했습니다. – WayneP
방금 url에/application을 추가했고 젠드 프레임 워크 페이지를 보여줍니다. 이 페이지는/응용 프로그램 비트가 URL에 추가되지 않았을 때 표시 될 것으로 예상 했습니까? – WayneP