Is it possible to make the URL view helper not url encode route segments?

I have a route that dynamically resizes an image when requested. The route
is:

'image'     => array(
                'type'    => 'segment',
                'options' => array(
                    'route'       => '/image/:width/:height/:image',
                    'constraints' => array(
                        'width'  => '[0-9]+',
                        'height' => '[0-9]+',
                        'image' => '[a-zA-Z0-9_\-/\.]+',
                    ),
                    'defaults'    => array(
                        'controller' => 'Faculty\Controller\Image',
                        'action'     => 'resize'
                    )
                ),
            ),

The 'image' segment is supposed to be able to link to any where in the
document root. So that I can link to, for instace,
mysite.com/image/300/300/uploads/profile/img_12345.jpg to get a 300x300
image from the file located at docroot/uploads/profile/img_12345.jpg.

When I try to use the url view helper, it url encodes the '/' and causes
the route not to match. The output of
$this->url('image',array('width'=>300,'height'=>300,'image'=>'uploads/profile/img_12345.jpg'))
is
mysite.com/image/300/300/uploads%2Fprofile%2Fimg_12345.jpg

How can I stop/get around this behavior?

Reply via email to