스켈레톤을 https://github.com/zendframework/ZendSkeletonApplication에서 다운로드했는데 정상적으로 작동합니다. 모든 것이 나에게 분명합니다.많은 모듈로 라우팅하는 방법은 무엇입니까?
하지만 다른 모듈을 추가하면 어떻게됩니까?
return array(
'modules' => array(
'Application',
'Api',
),
[...]
및 module.config.php에 경로를 변경 : 내가 이름을 변경, 골격에서 모듈을 복사 한 다음 application.config.php 내 새로운 모듈을 추가
return array(
'router' => array(
'routes' => array(
'api' => array(
'type' => 'Literal',
'options' => array(
'route' => 'api/',
'defaults' => array(
'__NAMESPACE__' => 'Api\Controller',
'controller' => 'Api',
'action' => 'api',
),
),
'may_terminate' => true,
'child_routes' => array(
'default' => array(
'type' => 'Segment',
'options' => array(
'route' => '/api[/:action]]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
),
),
),
),
),
),
),
'service_manager' => array(
'factories' => array(
'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
),
),
'translator' => array(
'locale' => 'en_US',
'translation_file_patterns' => array(
array(
'type' => 'gettext',
'base_dir' => __DIR__ . '/../language',
'pattern' => '%s.mo',
),
),
),
'controllers' => array(
'invokables' => array(
'Application\Controller\Index' => 'Application\Controller\IndexController',
'Application\Controller\Auth' => 'Application\Controller\AuthController'
),
),
'view_manager' => array(
'display_not_found_reason' => true,
'display_exceptions' => true,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => array(
'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' => array(
__DIR__ . '/../view',
),
),
);
을하지만 지금은 볼 Api에서 골격의 위치까지도 레이아웃. 그것을하는 방법?
모듈은 별도의 컨테이너가 아닙니다. 이들은 상호 관심사를 절단하고 응용 프로그램의 하위 섹션이 아닙니다. – Ocramius