젠드 프레임 워크 3을 설치했으며 액세스 컨트롤러가 어떻게되는지 잘 모릅니다.젠드 프레임 워크 3에서 라우팅과 관련된 문제가 있습니다.
이 내 URL입니다 :
http://localhost/catalog
경로 : 내가 잘못
<?php
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' => Controller\IndexController::class,
'action' => 'index',
],
],
],
'catalog' => [
'type' => Segment::class,
'options' => [
'route' => '/catalog[/: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',
],
],
];
을 뭐하는 거지?
인터넷에서 젠드 프레임 워크 3 가이드를 찾으려고했지만 아무 것도 찾지 못했습니다.
코드는 괜찮아 보입니다. http : // localhost/catalog를 방문하면 어떻게됩니까? –
그래서 문제를 실제로 설명해야합니다. 어떤 오류가 발생하고 있습니까? 404? 예외? – AlexP