是否可以使用包含正斜杠的参数组装一条路线?
配置:
'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