FAQ Database Discussion Community


Working with prefixes and Zend_Controller_Router_Route

php,zend-framework,zend-route
On an existing Zend Framework website with few controllers and no modules I need to add some prefixes to the default routes. For example, I currently have : /products /products/id/1 /training /commonpage I want to add a product line level, without duplicating my controllers in x modules (I'll just request...

Zend Framework Routing - child route works but not main route

php,zend-framework,zend-framework2,zend-route,zend-router
I have what I hope is quite a simple question, but it's been taking me a while to figure out... I have tried to setup a /settings route in Zend. I do not have a module for settings but I have setup the necessary views and controllers within the application...

What schould be the output of Zend\Mvc\Router\RouteInterface::assemble() in ZF2

php,zend-framework2,zend-route,zend-router
I'm writing my custom router for a Zend Framework 2 project extending Zend\Mvc\Router\RouteInterface. The routes should come from a database (large project with hundreds of pages). A working Router obviously only needs two methods: match() and assemble(). The match one I got working alright. But what about assemble()? What should...

Routing problems in ZF2 : Controller not mapped

php,zend-framework2,zend-route
I'm trying to create a simple CRUD in Zf2 to get to know it and I'm having problems routing the only controller I have. I have this error; "The requested controller could not be mapped to an existing controller class". I'm trying to call this route : http://zf2.local/Listapp This is...

How to route pages using text instead of IDs?

zend-framework,zend-framework2,zend-route,zend-router
Currently, my Zend application routes using the URL: example.com/news/12 Selects the news with ID 12 to display on page. But the client wants to use only text, example: example.com/news/man-dies-after-burning-himself Does someone knows how can it be done?...

ZF2 Segment Route doesn't match parent's constraint when using children

regex,routing,routes,zend-framework2,zend-route
I created the following routes: 'relatorios' => array( 'type' => 'Zend\Mvc\Router\Http\Segment', 'options' => array( 'route' => '/relatorios/:tipo', 'defaults' => array( 'controller' => 'Relatorios', 'action' => 'index', 'tipo' => 'normais', ), 'constraints' => array('tipo' => '(normais|administrativos)$', ), 'may_terminate' => true, 'child_routes' => array( 'view' => array( 'type' => 'Zend\Mvc\Router\Http\Segment', 'options' =>...