对于动态图像资源我想欺骗浏览器网址是图片而不是简单的动态网址。因此,我使用Zend_Controller_Router_Route
。我只是不确定如何填充我的reverse
字符串。我有以下路线构建:
'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',
)
我的Zend_Debug::dump('rerouted'); exit;
控制器没有触发。