2016-12-12 9 views
0

젠드 프레임 워크 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 가이드를 찾으려고했지만 아무 것도 찾지 못했습니다.

+0

코드는 괜찮아 보입니다. http : // localhost/catalog를 방문하면 어떻게됩니까? –

+0

그래서 문제를 실제로 설명해야합니다. 어떤 오류가 발생하고 있습니까? 404? 예외? – AlexP

답변

0

구성이 정확한 것처럼 보이지만 어떤 오류가 발생했는지 알지 못하면 잘못 된 것을 찾을 수 없습니다.

+1

아마도이 답변은 실제 답변이 아니므로 질문에 대한 의견이었을 것입니다. – Markus

+0

알아요,하지만 여전히 코멘트를 추가 할 수 없기 때문에 그것이 유일한 방법이었습니다. – Matteo