请教Yaf的问题
问题1.关于配置路由的问题, http://www.laruence.com/manual/yaf.routes.usage.html 这里的"例 8.2. 配置添加路由协议的例子"提到通过配置文件来书写路由配置
routes.regex.type="regex"
routes.regex.match="#^/list/([^/]*)/([^/]*)#"
routes.regex.route.controller=Index
routes.regex.route.action=action
routes.regex.map.1=name
routes.regex.map.2=value
然后我尝试着也加载成功了,可是我如果要再加一条正则路由是怎么写呢?
routes2.regex.type="regex"
routes2.regex.match="#^/xxx/([^/]*)/([^/]*)#"
routes2.regex.route.controller=Index
routes2.regex.route.action=action
routes2.regex.map.1=name
routes2.regex.map.2=value
这样吗?
目前为了添加多条路由规则,我只能直接用代码new路由规则addRoute了
==============
问题2:如何自定义ErrorController?
我编写了一个ErrorController继承了Yaf_Controller_Abstract,但是不知怎么启用它,好像没有配置项去配置这个东西
而且我在Bootstrap里手动new这个ErrorController的时候要求传三个参数,找了好久才知道三个参数分别是request,response,view
request我可以通过Dispatcher得到,但后两者就得不到
怎么才能让我的ErrorController成为它用于处理异常的Controller呢...