Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Yaf_Action_Abstract::getControllerYaf_View_Interface>
^Yaf_Action_AbstractLast updated: Mon, 26 Oct 2026

Yaf_Action_Abstract::getControllerName

(Yaf >=3.3.7)

Yaf_Action_Abstract::getControllerName — Get controller name

Description

public function Yaf_Action_Abstract::getControllerName(): ?string

Returns the name of the controller that owns this action.

Parameters

This function has no parameters.

Return Values

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

Examples

Example #1 Yaf_Action_Abstract::getControllerName() example

<?php
class ListAction extends Yaf_Action_Abstract
{
    public function execute() {
        // the name of the controller that owns this action,
        // e.g. "Product" for a ProductController
        var_dump($this->getControllerName());
    }
}
?>

The above example will output something similar to:

string(7) "Product"

See Also


<Yaf_Action_Abstract::getControllerYaf_View_Interface>
^Yaf_Action_AbstractLast updated: Mon, 26 Oct 2026