Skip to content

Instantly share code, notes, and snippets.

@eminetto
Last active December 18, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eminetto/5709324 to your computer and use it in GitHub Desktop.
Save eminetto/5709324 to your computer and use it in GitHub Desktop.
<?php
return array(
'controllers' => array( //lista os dois controllers do modulo
'invokables' => array(
'rest' => 'Api\Controller\RestController',
)
),
'router' => array( //rotas dos controllers
'routes' => array(
'restful' => array(
'type' => 'Segment',
'options' => array(
'route' => '/api/v1/:module[.:entity][.:formatter][/:id]',
'constraints' => array(
'module' => '[a-zA-Z][a-zA-Z0-9_-]*',
'entity' => '[a-zA-Z][a-zA-Z0-9_-]*',
'formatter' => '[a-zA-Z]+',
'id' => '[a-zA-Z0-9_-]*'
),
'defaults' => array(
'controller' => 'rest',
),
),
),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment