API15:JView/getName
From Joomla! Documentation
Description
Method to get the view name
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
getName()
Returns
string The name of the model
Defined in
libraries/joomla/application/component/view.php
Importing
jimport( 'joomla.application.component.view' );
Source Body
function getName()
{
$name = $this->_name;
if (empty( $name ))
{
$r = null;
if (!preg_match('/View((view)*(.*(view)?.*))$/i', get_class($this), $r)) {
JError::raiseError (500, "JView::getName() : Cannot get or parse class name.");
}
if (strpos($r[3], "view"))
{
JError::raiseWarning('SOME_ERROR_CODE',"JView::getName() : Your classname contains the substring 'view'. ".
"This causes problems when extracting the classname from the name of your objects view. " .
"Avoid Object names with the substring 'view'.");
}
$name = strtolower( $r[3] );
}
return $name;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples