Following is my module config file
return array(
'controllers' => array(
'invokables' => array(
'RSMobile\Controller\User' => 'RSMobile\Controller\UserController',
),
),
// Routes for API calls
'router' => array(
'routes' => array(
'rsmobile' => array(
'type' => 'segment',
'options' => array(
'route' => '/rsmobile',
'defaults' => array(
'controller' => 'RSMobile\Controller\User',
)
),
// Child routes
'child_routes' => array(
// Route for "user" API
'user' => array(
'type' => 'segment',
'options' => array(
'route' => '/user[/:id]',
'constraints' => array(
'id' => '[0-9a-zA-Z]+',
),
'defaults' => array(
'controller' => 'RSMobile\Controller\User',
)
),
),
)
Question:
I have extends AbstractRestfulController in UserController file but, when i call this with www.example.com/rsmobile/user?userid=1 it call get-list instead of get.
Any Light on path would be helpful
Thanks
I think you want to use
www.example.com/rsmobile/user?userid=1pattern only and notwww.example.com/rsmobile/user/1.In
AbstractRestfulController,$identifierNameis set toid, by default. If it does not findidin list of params then it will callgetList()method. So what you can do is in your controller(which must be extendingAbstractRestfulController) write below code :