List all routes from an application using Zend Framework 2 -
how list routes have defined in our application zend framework 2?
by "routes" mean defined in:
module/[modulename]/config/module.config.php
under
'router' => array( 'routes' => array( ... ) )
i need list them can't figure out how , nor documentation nor forums helped me now.
you can find complete (merged) config or dump router itself. there no way export route objects, there i've disappoint you.
to complete config, service locator:
// $sl instanceof zend\servicemanager\servicemanager $config = $sl->get('config'); $routes = $config['router']['routes'];
if want view routes debugging purposes, can use var_dump
or similar on router object:
// $sl instanceof zend\servicemanager\servicemanager $router = $sl->get('router'); var_dump($router);
to route instances can build routes using route plugin manager, not sure that's way want go...
Comments
Post a Comment