Yaf_Request_Abstract::getControllerName
PHP Manual
PHP Manual»Yaf_Request_Abstract»Yaf_Request_Abstract::getControllerName

Yaf_Request_Abstract::getControllerName

(Yaf >=1.0.0)

Yaf_Request_Abstract::getControllerName — Retrieve the controller name

Açıklama

public function Yaf_Request_Abstract::getControllerName(): ?string

Retrieve the controller name

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

The controller name, or null if not set.

Örnekler

Örnek 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());
    }
}
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

string(7) "Product"

Ayrıca Bakınız

To Top