« Yaf_Controller_Abstract::getModuleName
Yaf_Controller_Abstract::getRequest »

Yaf_Controller_Abstract::getName

(Yaf >=3.2.0)

Yaf_Controller_Abstract::getName — Get controller name

説明

public function Yaf_Controller_Abstract::getName(): ?string

Returns the name of the controller.

パラメータ

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

戻り値

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

例

例1 Yaf_Controller_Abstract::getName() example

<?php
class ProductController extends Yaf_Controller_Abstract
{
    public function indexAction() {
        // the controller name, without the "Controller" suffix
        var_dump($this->getName());
    }
}
?>

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

string(7) "Product"

参考

関連キーワード:
Controller   Abstract   controller   getName   getModuleName   getControllerName   getRequest   example   ProductController   extends   indexAction   without   suffix   dump   Product   参考   Request
関連する関数・ページ:
yaf-controller-abstract.getmodulename   yaf-controller-abstract.construct   yaf-controller-abstract.getrequest   yaf-controller-abstract.init   yaf-controller-abstract.getresponse   yaf-controller-abstract.redirect