I configured a route task in module.configure as follows
'router' => array(
'routes' => array(
'task' => array(
'type' => 'Segment',
'options' => array(
'route' =>
'/task[/:action[/:id]]',
'defaults' => array(
'__NAMESPACE__' =>
'Checklist\Controller',
'controller' =>
'Task',
'action' =>
'index',
),
'constraints' => array(
'action' =>
'^add|edit|delete$',
'id' => '[0-9]+',
),
),
),
),
),
*echo $this->url('task', array('action'=>'add'))* will return */task/add *
What i want is to define the route in parent-child format
i slitely alter the code in module.config.php to make it as parent-child
format as follows
'task' => array(
'type' => 'Literal',
'options' => array(
'route' => '/task',
'defaults' => array(
'__NAMESPACE__' => 'Checklist\Controller',
'controller' => 'Task',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
'default' => array(
'type' => 'Segment',
'options' => array(
'route' => '[/:action]',
'constraints' => array(
'action' =>
'[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
),
),
),
),
),
),
but in my view file when echo $this->url('task', array('action'=>'add'))
returns only */task* instead of */task/add*
By giving direct url say tasklist/task/add is accessible form the browser
How to configure route in parent -child format to get /task/add by echo
$this->url('task',array('action'=>'add'))
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Zend-Route-with-parent-child-format-not-working-for-view-helper-this-url-in-expected-way-tp4661936.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]