Added some more events to compiler. Added new helper method to make safeClassFunctionName.

This commit is contained in:
2019-07-07 00:29:35 +02:00
parent 504abe4751
commit 3497104f41
9 changed files with 66 additions and 18 deletions

View File

@ -124,6 +124,24 @@ abstract class ComponentbuilderHelper
'JPATH_THEMES' => JPATH_THEMES
);
/**
* Making class or function name safe
*
* @input string The name you would like to make safe
*
* @returns string on success
**/
public static function safeClassFunctionName($name)
{
// remove numbers if the first character is a number
if (is_numeric(substr($name, 0, 1)))
{
$name = self::replaceNumbers($name);
}
// remove all spaces and strange characters
return trim(reg_replace("/[^A-Za-z0-9]/", '', $name));
}
/**
* The field builder switch
**/