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');
Afficher le fichier
Open project: yiisoft/yii
Class Usage Examples
Méthodes publiques
Méthodes publiques
Method Details
_checkDefines()
public méthode
Called by subclssses' constructors to enable/disable
optional highlighter rules
_getToken()
public méthode
_matchingBrackets()
public méthode
Helper function to find matching brackets
factory()
public static méthode
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 |
Résultat |
mixed |
a newly created Highlighter object, or
a PEAR error object on error |
highlight()
public méthode
setRenderer()
public méthode
Property Details
$_conditions public_oe property
public array $_conditions |
Résultat |
array |
|
$_disabled public_oe property
public array $_disabled |
Résultat |
array |
|
$_language public_oe property
public string $_language |
Résultat |
string |
|
$_options public_oe property
public array $_options |
Résultat |
array |
|
$_renderer public_oe property
public array $_renderer |
Résultat |
array |
|
$_syntax public_oe property
Auto-generated classes set this var
public array $_syntax |
Résultat |
array |
|