Hej,
Mam problem z przekierowaniami w zend framework. Nieważne czy robię je w kontrolerze czy w widoku zawsze przekierowuje mnie do modułu ignorując kontroler i akcję, np:
echo $this->url('users', array('controller' => 'index', 'action' => 'register'));
Generuje link /users natomiast oczekiwał bym /users/index/register w tym przypadku. jeżeli zrobię w kontrolerze:
return $this->redirect()->toRoute('users', array('controller' => 'index', 'action' => 'register'));
to przekierowanie wystepuje ale tylko do adresu /users a oczekiwałbym /users/index/register.
Ponizej mój routing
'users' => array(
'type' => 'Literal',
'options' => array(
'route' => '/users',
'defaults' => array(
'__NAMESPACE__' => 'Users\Controller',
'controller' => 'Index',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
'default' => array(
'type' => 'Segment',
'options' => array(
'route' => '/[:controller]/[:action]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
),
),
),
),
),