2016-12-12 12 views
0

私はZend Framework 3をインストールしました。私はZend Framework 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', 
     ], 
    ], 
]; 

私が間違って何をしているのですか?

私はインターネット上でZend Framework 3のガイドを見つけようとしましたが、何も見つかりませんでした。

+0

コードは大丈夫です。 http:// localhost/catalogにアクセスするとどうなりますか? –

+0

実際に問題を説明する必要があります。あなたはどんなエラーを出していますか? 404?例外? – AlexP

答えて

0

構成は正しいようですが、どのエラーが表示されているのかわからず、何が間違っているかを見つけることは不可能です。

+1

本当の答えではないので、この回答は質問のコメントであったはずです。 – Markus

+0

私は知っていますが、私はまだコメントを追加することができないので、それを行う唯一の方法でした。 – Matteo

関連する問題