WhatsApp

It is a method to get the view name. The model name by default parsed using the classname, or it can be set by passing a $config['name'] in the class constructor.

  • return string - The name of the model
public function getName()
{
if (empty($this->_name))
{
$classname = get_class($this);
$viewpos = strpos($classname, 'View');

if ($viewpos === false)
{
throw new \Exception(\JText::_('JLIB_APPLICATION_ERROR_VIEW_GET_NAME'), 500);
}

$this->_name = strtolower(substr($classname, $viewpos + 4));
}

return $this->_name;
}

 

Html View
Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive