0
我在zend framework2中遇到了一些麻煩,爲我的安靜api設置路線。我想以這種格式創建路線:api-rest/wall/user_id/post [/:id]。ZF2安靜的API兒童路線
現在,這是我的配置文件:
'router' => array(
'routes' => array(
'api-rest' => array(
'type' => 'segment',
'options' => array(
'route' => '/api-rest/wall[/:id]',
'constraints' => array(
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'ApiRest\Controller\Wall',
),
),
),
),
),