当我以http://www.example.com/Formación
的身份访问url时那么路由应该匹配,但它不起作用,因为我有一个字符ó
,如何使这个ó
西班牙语字符与ZF中的以下路由兼容?
$route = Http'Segment::factory(array(
'route' => '/Formación', //<<<<< this character must be used: ó
'defaults' => array(
'controller' => 'Application'Controller'Trainingsignup',
'action' => 'index'
),
));
$router->addRoute('traininges', $route, null);
EDIT:跟随失败
'constraints' => array(
'controller' => '[a-zA-ZóäöüÄÖÜß][a-zA-ZóäöüÄÖÜß0-9_-]+',
'action' => '[a-zA-ZóäöüÄÖÜß][a-zA-ZóäöüÄÖÜß0-9_-]+',
),
EDIT:跟随失败
'constraints' => array(
'controller' => '/^'p{L}['p{L} _.-]+$/u', //or /['p{L}]+/u
'action' => '/^'p{L}['p{L} _.-]+$/u', //or /['p{L}]+/u
),
我诚实的回答是:不要这样做-请只使用ASCII。
但如果你真的想:如何在Zend Framework 2中为RegEx路由的RegEx设置(UTF8)修饰符?