Back to InstallerAdapter class

Method getElement

public string
getElement
(mixed $element = null)
Get the filtered extension element from the manifest
Parameters
  • string $element Optional element name to be converted
Returns
  • string The filtered element
Since
  • 3.4

Method getElement - Source code

/**
 * Get the filtered extension element from the manifest
 *
 * @param   string  $element  Optional element name to be converted
 *
 * @return  string  The filtered element
 *
 * @since   3.4
 */
public function getElement($element = null)
{
    if (!$element) {
        // Ensure the element is a string
        $element = (string) $this->getManifest()->element;
    }
    if (!$element) {
        $element = $this->getName();
    }
    // Filter the name for illegal characters
    return strtolower(InputFilter::getInstance()->clean($element, 'cmd'));
}