0
현재 저는 ZF2를 배우고 있습니다. "시작하기"를 진행하면서 모듈의 각 설정 파일이 PHP 배열로 가득차 있다는 것을 알았습니다. 문서의 예 :젠드 프레임 워크 구성 파일 JSON
<?php
return array(
'controllers' => array(
'invokables' => array(
'Album\Controller\Album' => 'Album\Controller\AlbumController',
),
),
// The following section is new and should be added to your file
'router' => array(
'routes' => array(
'album' => array(
'type' => 'segment',
'options' => array(
'route' => '/album[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Album\Controller\Album',
'action' => 'index',
),
),
),
),
),
'view_manager' => array(
'template_path_stack' => array(
'album' => __DIR__ . '/../view',
),
),
);
배열이있는 배열의 배열. 사실, 배열은 함수의 이름 일 뿐이며 키/값 쌍을 가진지도와 비슷합니다. http://framework.zend.com/manual/2.0/en/user-guide/routing-and-controllers.html#comment-696979913
사람이 초보자에 대한 예를 제공 할 수 있습니까 : 젠드 MODS의
하나는 우리가 설정 파일에 대한 JSON을 사용할 수 있다는 지적? 배열/맵 대신 JSON 형식을 사용하는 것을 선호하지만 ZF 홈페이지에서 찾을 수 없습니다. 아니면 내가하지 말아야 할까?
내가 JSON을 사용하여 무리를 줄 것입니다. 트랙을 따라 가다 보면 구성 파일에 ServiceManager의 한 줄 팩터 리를 만들고 싶을 것이므로 PHP에서 필요합니다. – superdweebie
모든''배열 ('')이 너를 짜증나게 만들면, PHP 5.4의'[]'배열 구문을 사용한다. – superdweebie