Yaf_Router::getCurrentRoute
(Since Yaf 1.0.0.5)
例 11.87. Yaf_Router::getCurrentRoute 的例子
<?php
class UserPlugin extends Yaf_Plugin_Abstract {
public function routerShutdown(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) {
echo "生效的路由协议是:" . Yaf_Dispatcher::getInstance()->getRouter()->getCurrentRoute();
}
}
?>
本方法需要在路由过程结束之后调用, 在路由过程结束之前, 本方法一直返回NULL.