/**
* 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;
}