PHP 8.6.0 Beta 3 is available for testing

Yaf_Request_Abstract::getControllerName

(Yaf >=1.0.0)

Yaf_Request_Abstract::getControllerNameRetrieve the controller name

Descrizione

public function Yaf_Request_Abstract::getControllerName(): ?string

Retrieve the controller name

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

The controller name, or null if not set.

Esempi

Example #1 Yaf_Request_Abstract::getControllerName() example

<?php
class ProductController extends Yaf_Controller_Abstract
{
    public function viewAction()
    {
        // Assuming the request is /product/view/id/17
        var_dump($this->getRequest()->getControllerName());
    }
}
?>

Il precedente esempio visualizzerà qualcosa simile a:

string(7) "Product"

Vedere anche:

add a note

User Contributed Notes

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