PHP 8.6.0 Beta 3 is available for testing

Yaf_Controller_Abstract::getName

(Yaf >=3.2.0)

Yaf_Controller_Abstract::getNameGet 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"

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top