J'ai installé Zend Framework 3, et je ne sais pas comment le contrôleur d'accès.J'ai un problème avec mon routage sur Zend Framework 3
c'est mon url:
http://localhost/catalog
route:
<?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',
],
],
];
Qu'est-ce que je fais mal?
J'ai essayé de trouver un guide Zend Framework 3 sur internet et je n'ai rien trouvé.
Le code semble correct. Que se passe-t-il lorsque vous visitez http: // localhost/catalog? –
Vous avez donc besoin d'expliquer le problème. Quelle erreur obtenez vous? 404? Exception? – AlexP