Class CTextHighlighter
CTextHighlighter does syntax highlighting for its body content.
The language of the syntax to be applied is specified via CTextHighlighter::$language
property. Currently, CTextHighlighter supports the following languages: ABAP,
CPP, CSS, DIFF, DTD, HTML, JAVA, JAVASCRIPT, MYSQL, PERL, PHP, PYTHON, RUBY,
SQL, XML. By setting CTextHighlighter::$showLineNumbers
to true, the highlighted result may
be shown with line numbers.
- CComponent
- CBaseController
- CWidget
- CFilterWidget implements IFilter
- COutputProcessor
- CTextHighlighter
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/web/widgets/CTextHighlighter.php
public
|
#
processOutput( string $output )
Processes the captured output. This method highlights the output according to
the syntax of the specified |
public
string
|
|
public
|
|
public static
|
init(),
onProcessOutput(),
run()
|
__construct(),
filter(),
getIsFilter()
|
actions(),
getController(),
getId(),
getOwner(),
getViewFile(),
getViewPath(),
render(),
setId()
|
beginCache(),
beginClip(),
beginContent(),
beginWidget(),
createWidget(),
endCache(),
endClip(),
endContent(),
endWidget(),
renderFile(),
renderInternal(),
widget()
|
public
string
|
$language |
|
#
the language whose syntax is to be used for highlighting. Valid values are those file names (without suffix) that are contained in 'vendors/TextHighlighter/Text/Highlighter'. Currently, the following languages are supported: ABAP, CPP, CSS, DIFF, DTD, HTML, JAVA, JAVASCRIPT, MYSQL, PERL, PHP, PYTHON, RUBY, SQL, XML If a language is not supported, it will be displayed as plain text. Language names are case-insensitive. |
public
boolean
|
$showLineNumbers | false |
#
whether to show line numbers in the highlighted result. Defaults to false. |
public
string
|
$lineNumberStyle | 'list' |
#
the style of line number display. It can be either 'list' or 'table'. Defaults to 'list'. |
public
integer
|
$tabSize | 4 |
#
tab size. Defaults to 4. |
public
mixed
|
$cssFile |
|
#
the CSS file used for the widget. Defaults to null, meaning using the default CSS file included together with the widget. If false, no CSS file will be used. Otherwise, the specified CSS file will be included when using this widget. |
public
array
|
$containerOptions | array() |
#
the HTML attributes to be applied to the container element. The highlighted content is contained in a DIV element. |
$stopAction
|
$actionPrefix,
$skin
|
$isFilter
|
$controller,
$id,
$owner,
$viewPath
|