Back to RouterView class

Method getName

public string
getName
()
Method to return the name of the router
Returns
  • string Name of the router
Since
  • 3.5
Class: RouterView
Project: Joomla

Method getName - Source code

/**
 * Method to return the name of the router
 *
 * @return  string  Name of the router
 *
 * @since   3.5
 */
public function getName()
{
    if (empty($this->name)) {
        $r = null;
        if (!preg_match('/(.*)Router/i', \get_class($this), $r)) {
            throw new \Exception('JLIB_APPLICATION_ERROR_ROUTER_GET_NAME', 500);
        }
        $this->name = str_replace('com_', '', ComponentHelper::getComponentName($this, strtolower($r[1])));
    }
    return $this->name;
}