PHP 클래스 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');
파일 보기
프로젝트 열기: yiisoft/yii
1 사용 예제들
공개 프로퍼티들
공개 메소드들
메소드 상세
Called by subclssses' constructors to enable/disable
optional highlighter rules
_matchingBrackets()
공개 메소드
Helper function to find matching brackets
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 |
리턴 |
mixed |
a newly created Highlighter object, or
a PEAR error object on error |
프로퍼티 상세
public array $_conditions |
리턴 |
array |
|
public array $_disabled |
리턴 |
array |
|
public string $_language |
리턴 |
string |
|
public array $_options |
리턴 |
array |
|
public array $_renderer |
리턴 |
array |
|
Auto-generated classes set this var
public array $_syntax |
리턴 |
array |
|