라우팅 문제가 발생했지만 해결할 수없는 경우에도 스켈레톤 애플리케이션 및 모듈을 사용하여 기본 Zend Framework 2 애플리케이션을 만들었습니다. 느슨하게 젠드 프레임 워크 웹 사이트에 새로운 빠른 모듈을 기반으로 내 모듈, 내URL에 데이터를 전달할 때의 라우팅
, 내가 module.config.php 내에서 다음과 같은 경로가
'router' => array(
'routes' => array(
'blog' => array(
'type' => 'Literal',
'options' => array(
// Change this to something specific to your module
'route' => '/blog',
'defaults' => array(
// Change this value to reflect the namespace in which
// the controllers for your module are found
'__NAMESPACE__' => 'Blog\Controller',
'controller' => 'View',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
// This route is a sane default when developing a module;
// as you solidify the routes for your module, however,
// you may want to remove it and replace it with more
// specific routes.
'default' => array(
'type' => 'Segment',
'options' => array(
'route' => '[/:controller[/:action]]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
),
),
),
),
),
),
),
이 경로는 사용할 때 잘 작동이 나타납니다
blah.com/blog/post/view/id/1
01 : 표준 모듈, 컨트롤러와 액션의 URL 요청 : 나는 URL을 통해 일부 데이터를 전달하려고 할 때이 문제가 발생하고
blah.com/blog/post/view
입니다
두 URL 중 두 번째 URL의 결과는 404입니다. 필요한 정보가 정확히 붙어 있어도 데이터를 URL에 전달할 수 있도록 어린이 경로가 필요합니다. 누구든지 올바른 방향으로 나를 가리킬 수 있습니까? 라인을 가로 지르지는 못했지만 참조 가이드를 탐색했습니다.
도움을 주시면 감사하겠습니다.
감사합니다. 내 문제를 정리 한 것 같아, 환호. – Asciant