[英]zend framework 2 Routing with UTF-8 Regex Pattern
我希望我的路由支持波斯语字符,但在正则表达式路径中使用x {600} - \\ x {6FF}时,app会给我一个404错误(找不到页面)
我的zf2路由配置:
'result' => array(
'type' => 'segment',
'options' => array(
'route' => '/Result[/:name]',
'constraints' => array(
'name' => '[\sa-zA-Z0-9_.-x{600}-\x{6FF}]*',
),
'defaults' => array(
'controller' => 'Result',
'action' => 'index',
),
),
),
我将u
添加到Zend \\ Mvc \\ Router \\ Http \\ Segment.php中的正则表达式的结尾
if ($pathOffset !== null) {
$result = preg_match('(\G' . $regex . ')u', $path, $matches,null, $pathOffset);
} else {
$result = preg_match('(^' . $regex . '$)u', $path, $matches);
}
我的网址是这样的:
http://localhost/test/Result/A.8.کلمه
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.