我需要能够看到" beforeDispatch"被请求的行动是否可以发送" (类似于Zend Framework' Dipatcher::isDispatchable()
方法。
问题:
如何检测" beforeDispatch"请求的行动是否会失败?
谢谢!
答案 0 :(得分:2)
我认为您可以尝试使用 beforeExecuteRoute 代替您的应用程序(ACL)。
正如你在这里看到的那样:http://docs.phalconphp.com/pl/latest/reference/dispatching.html#dispatch-loop-events,仍有可能停止操作并抛出异常。
由于这种方法,您还将省略错误页面和不存在的路由之间的循环问题。