« Yaf_Action_Abstract::getController
Yaf_View_Interface »

Yaf_Action_Abstract::getControllerName

(Yaf >=3.3.7)

Yaf_Action_Abstract::getControllerName — Get controller name

説明

public function Yaf_Action_Abstract::getControllerName(): ?string

Returns the name of the controller that owns this action.

パラメータ

この関数にはパラメータはありません。

戻り値

The controller name as a string, or null if it is not set.

例

例1 Yaf_Action_Abstract::getControllerName() example

<?php
class ListAction extends Yaf_Action_Abstract
{
    public function execute() {
        // the name of the controller that owns this action,
        // e.g. "Product" for a ProductController
        var_dump($this->getControllerName());
    }
}
?>

上の例の出力は、 たとえば以下のようになります。

string(7) "Product"

参考

関連キーワード:
Abstract   Action   controller   getControllerName   getController   owns   action   Product   View   Interface   example   ListAction   extends   execute   ProductController   dump   参考   コントローラ   Controller   getName
関連する関数・ページ:
yaf-action-abstract.getcontroller   class.yaf-action-abstract   yaf-action-abstract.execute   yaf-controller-abstract.getname   yaf-request-abstract.getcontrollername   yaf-controller-abstract.getrequest