(Yaf >=1.0.0)
Yaf_Controller_Abstract::getRequest — 获取当前请求对象
返回与该控制器关联的 Yaf_Request_Abstract 实例。
此函数没有参数。
Yaf_Request_Abstract 实例,如果没有可用的请求则返回 null。
示例 #1 Yaf_Controller_Abstract::getRequest() 示例
<?php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction() {
$request = $this->getRequest();
var_dump($request->getModuleName());
var_dump($request->getControllerName());
var_dump($request->getActionName());
}
}
?>以上示例的输出类似于:
string(5) "Index" string(5) "Index" string(5) "index"