是否可以使用包含正斜杠的参数组装路径?
配置:
'someroute' => array(
'type' => 'Zend\Mvc\Router\Http\Segment',
'options' => array(
'route' => 'someroute/:path',
'defaults' => array(
'controller' => 'Controller',
'action' => 'index'
),
'constraints' => array(
'path' => '(.)+'
)
)
)
控制器:
$path = 'some/subdirectory';
$this->url('someroute', array('path' => $path));
结果是:
http://host.name/someroute/some%2Fsubdirectory
解决方法:
在视图中使用rawurldecode()当然可以解决这个问题.