(Yaf >=1.0.0)
Yaf_Request_Abstract::getControllerName — 获取控制器名称
此函数没有参数。
控制器名称;如果未设置,则返回 null。
示例 #1 Yaf_Request_Abstract::getControllerName() 示例
<?php
class ProductController extends Yaf_Controller_Abstract
{
public function viewAction()
{
// 假设请求是 /product/view/id/17
var_dump($this->getRequest()->getControllerName());
}
}
?>以上示例的输出类似于:
string(7) "Product"