Yaf_Controller_Abstract::getName
PHP Manual
PHP Manual»Yaf_Controller_Abstract»Yaf_Controller_Abstract::getName

Yaf_Controller_Abstract::getName

(Yaf >=3.2.0)

Yaf_Controller_Abstract::getName — Get controller name

Beschreibung

public function Yaf_Controller_Abstract::getName(): ?string

Returns the name of the controller.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

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

Beispiele

Beispiel #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());
    }
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

string(7) "Product"

Siehe auch

To Top