PHP7 看官方源码出错Yaf_Route_Regex::route(): Delimiter must not be alphanumeric or backslash
yaf的手册地址:http://yaf.laruence.com/manual/index.html
需要采用正规格式。如通过goods-11.html访问,如下定义
// 创建一个路由协议实例
$router=Yaf_Dispatcher::getInstance()->getRouter();
$route = new Yaf_Route_Regex(
'/goods-([0-9]+).html/',
array('controller' => 'goods','action' => 'views'),
array(1 => 'id')
);
//使用路由器装载路由协议
$router->addRoute('product', $route);