Routing Issue: Query string causing routing fail

For programming and general questions on Zend Framework

Routing Issue: Query string causing routing fail

Postby sarge_ch on Sun Feb 03, 2013 9:06 pm

Dear all

I am tracking an error in my routing since quite some time now.

This is my route:

Code: Select all
// Catalog route
$routeCatalog = Mvc\Router\Http\Segment::factory(array(
  'route'    => '/:segment',
  'defaults' => array(
    '__NAMESPACE__' => __NAMESPACE__ . '\Controller',
    'controller'    => 'catalog',
    'action'        => 'index'
  )
));


which is then put together in a part route as follows:

Code: Select all
// Catalog route assembled
$routePartCatalog = Mvc\Router\Http\Part::factory(array(
  'route'         => $routeCatalog,
  'route_plugins' => $router->getRoutePluginManager(),
  'may_terminate' => true,
  'child_routes'  => array(
    'product' => $routeProduct,
    'static'  => $routeStatic
  )
));


The part route is then added to the router:

Code: Select all
$router->addRoute('catalog', $routePartCatalog, 5);


So this basically allows me to route urls like

somedomaindotcom/some-segment
or
somedomaindotcom/some-different-segment

which is all nice. But now; if I add any query string like

somedomaindotcom/some-different-segment?debug=yes

the routing completely fails resulting in a "The requested URL could not be matched by routing." error.

I would greatly appreciate any help around this topic.

Best regards
sArge
sarge_ch
 
Posts: 2
Joined: Sun Feb 03, 2013 8:57 pm

Re: Routing Issue: Query string causing routing fail

Postby sarge_ch on Sun Feb 03, 2013 10:03 pm

Update on thisone:

My part route there obviously needs a

Code: Select all
$routeQuery = Mvc\Router\Http\Query::factory();


child route for some to me yet unknown reason.
sarge_ch
 
Posts: 2
Joined: Sun Feb 03, 2013 8:57 pm


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 6 guests