Yaf_Controller_Abstract::getName

Get controller name

Description

public stringnull Yaf_Controller_Abstract::getName()

Returns the name of the controller.

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

The above example will output something similar to:

string(7) "Product"

See Also

  • Yaf_Controller_Abstract::getModuleName
  • Yaf_Request_Abstract::getControllerName