Zend Route Regex not working

62 Views Asked by At

For dynamic image resourcing I want to fool the browser the url is image instead of a 'plain'/dynamic url. Therefor I'm using Zend_Controller_Router_Route. I'm just not sure how to fill my reverse string. I have the following route build:

'refactor-index-index-public' =>
  array(
    'type' => 'Zend_Controller_Router_Route_Regex',
    'route' => '\/public\/upload\/img\/(\w+)\/(\d+)x(\d+)\/(\d+)\/(\d+)\/(\d+)\/img.(\w+)',
    //'route' => "/public/upload/img/testimage/500x500/0/0/0/img.webp",
    'defaults' =>
    array(
      'module' => 'refactor',
      'controller' => 'index',
      'action' => 'index',
    ),
    'map' =>
    array(
      'id'          => 1,
      'width'       => 2,
      'height'      => 3,
      'keepSmaller' => 4,
      'keepRatio'   => 5,
      'crop'        => 6,
      'extension'   => 7,
    ),
    'reverse'       => '/public/upload/img/%s/%dx%d/%d/%d/%d/img.%s',
  )

My controller with a Zend_Debug::dump('rerouted'); exit; is not triggering.

0

There are 0 best solutions below