Bitrix Site Manager

oBXEditorUtils.PHPParser

The nested PHPParser object brings amalgamates methods used to simplify creation of PHP parsers (oBXEditorUtils.addPHPParser).

Methods

Method Description
cleanCode Cleans PHP code of comments, line feeds and carriage returns, excessive whitespace.
getArray Takes a piece of PHP code in the format "Array([parameters])" and returns an array of parameters passed in the string. The method can correctly process both nested and associated arrays.
getParams Takes comma-separated parameters and returns an array of string values. Does not process arrays.
parseFunction Takes a string containing a PHP function call. Returns the function name and the string with parameters.
parseParameters Takes comma-separated parameters and returns an array of these parameters. The method can processes arrays as parameters.
trimPHPTags Strips <?php ?> or <? ?> off the PHP tags passed as the parameter.
trimQuotes Unquotes a code fragment.