Hi Everyone,

I am currently using ZF2 /AbstractRestfulController/ to build an API.  I
understand /GET /recording/ is mapped to /getList()/ method and /GET
/recording[/:id]/ is mapped get($id) method in the controller that extends
/AbstractRestfulController/.

What is a good way to configure the router when there is a hierarchical
relationship such as:
/recording/person/[:id] (recordings with person id of :id)?

Here is my current route:
routes => array(
            'recording' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/recording[/:id]',
                    'constraints' => array(
                        'id' => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'API\Controller\Recording'
                    ),
                ),
            ),

Thanks



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/How-to-handle-Hierarchical-Association-in-URI-with-ZF2-AbstractRestfulController-tp4659556.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to