PHP Class Text_Highlighter, yii
This class implements all functions necessary for highlighting,
but it does not contain highlighting rules. Actual highlighting is
done using a descendent of this class.
One is not supposed to manually create descendent classes.
Instead, describe highlighting rules in XML format and
use {@link Text_Highlighter_Generator} to create descendent class.
Alternatively, an instance of a descendent class can be created
directly.
Use {@link Text_Highlighter::factory()} to create an
object for particular language highlighter
Usage example
require_once 'Text/Highlighter.php';
$hlSQL = Text_Highlighter::factory('SQL',array('numbers'=>true));
echo $hlSQL->highlight('SELECT * FROM table a WHERE id = 12');
Mostrar archivo
Open project: yiisoft/yii
Class Usage Examples
Public Properties
Public Methods
Method Details
_checkDefines()
public method
Called by subclssses' constructors to enable/disable
optional highlighter rules
_getToken()
public method
_matchingBrackets()
public method
Helper function to find matching brackets
factory()
public static method
Create a new Highlighter object for specified language
public static factory ( string $lang, array $options = [] ) : mixed |
$lang |
string |
language, for example "SQL" |
$options |
array |
Rendering options. This
parameter is only keeped for BC reasons, use
{@link Text_Highlighter::setRenderer()} instead |
return |
mixed |
a newly created Highlighter object, or
a PEAR error object on error |
highlight()
public method
setRenderer()
public method
Property Details
$_conditions public_oe property
public array $_conditions |
return |
array |
|
$_disabled public_oe property
public array $_disabled |
return |
array |
|
$_language public_oe property
public string $_language |
return |
string |
|
$_options public_oe property
public array $_options |
return |
array |
|
$_renderer public_oe property
public array $_renderer |
return |
array |
|
$_syntax public_oe property
Auto-generated classes set this var
public array $_syntax |
return |
array |
|