php - GET parameters missing on ZF2 -


i'm trying build controller function 'external' url , translate internal url. external url following: http://localhost/dir/public/api?entity=11 , url internal like: http://localhost/dir/public/en/entity/1254. module.conf.php this:

'router' => array(     'routes' => array(         'api' => array(             'type' => 'zend\mvc\router\http\segment',             'options' => array(                 'route'    => '/api',                 'defaults' => array(                     '__namespace__' => 'extranet\controller',                     'controller' => 'api',                     'action' => 'index',                 ),             ),         ),         'home' => array(             'type' => 'zend\mvc\router\http\segment',             'options' => array(                 'route' => '[/:locale]',                 'constraints' => array(                     'locale' => 'ca|es|en',                 ),                 'defaults' => array(                     '__namespace__' => 'extranet\controller',                     'controller' => 'entity',                     'action' => 'index',                     'locale' => 'ca',                 ),             ),             'may_terminate' => true,             'child_routes' => array(                 'default' => array(                     'type' => 'segment',                     'options' => array(                         'route' => '[/:controller[/:id]]',                         'constraints' => array(                             'controller' => '(?!intranet)(?!api)([a-za-z][a-za-z0-9_-]+)',                             'id' => '[a-z0-9]+',                         ),                     ),                     'defaults' => array(                         '__namespace__' => 'extranet\controller',                         'controller' => 'index',                         'action' => 'index',                     ),                 ),             ),         ),     ), ), 

the problem when write on controller : $this->params()->fromquery(); params empty , not understand why, because if write var_dump() in code, works!. i'm desperated.

thanks


Comments