PHP Class Prado\Web\UI\WebControls\TTextHighlighter

TTextHighlighter does syntax highlighting its body content, including static text and rendering results of child controls. You can set {@link setLanguage Language} to specify what kind of syntax the body content is. Currently, TTextHighlighter supports the following languages: ABAP, CPP, CSS, DIFF, DTD, HTML, JAVA, JAVASCRIPT, MYSQL, PERL, PHP, PYTHON, RUBY, SQL, XML and PRADO, where PRADO refers to PRADO template syntax. By setting {@link setShowLineNumbers ShowLineNumbers} to true, the highlighted result may be shown with line numbers. Note, TTextHighlighter requires {@link THead} to be placed on the page template because it needs to insert some CSS styles.
Since: 3.0
Inheritance: extends TTextProcessor
Afficher le fichier Open project: pradosoft/prado Class Usage Examples

Méthodes publiques

Méthode Description
getEnableCopyCode ( ) : boolean
getLanguage ( ) : string
getLineNumberStyle ( ) : TTextHighlighterLineNumberStyle
getShowLineNumbers ( ) : boolean
getTabSize ( ) : integer
onPreRender ( $writer ) Registers css style for the highlighted result.
processText ( $text ) : string Processes a text string.
render ( $writer )
setEnableCopyCode ( $value )
setLanguage ( $value )
setLineNumberStyle ( $value )
setShowLineNumbers ( $value )
setTabSize ( $value )

Méthodes protégées

Méthode Description
getHeaderTemplate ( ) : string
getTagName ( ) : string
registerStyleSheet ( ) Registers the stylesheet for presentation.

Method Details

getEnableCopyCode() public méthode

public getEnableCopyCode ( ) : boolean
Résultat boolean true will show "Copy Code" link. Defaults to false.

getHeaderTemplate() protected méthode

protected getHeaderTemplate ( ) : string
Résultat string header template with "Copy code" link.

getLanguage() public méthode

public getLanguage ( ) : string
Résultat string language whose syntax is to be used for highlighting. Defaults to 'php'.

getLineNumberStyle() public méthode

public getLineNumberStyle ( ) : TTextHighlighterLineNumberStyle
Résultat TTextHighlighterLineNumberStyle style of row number, Table by default

getShowLineNumbers() public méthode

public getShowLineNumbers ( ) : boolean
Résultat boolean whether to show line numbers in the highlighted result.

getTabSize() public méthode

public getTabSize ( ) : integer
Résultat integer tab size. Defaults to 4.

getTagName() protected méthode

protected getTagName ( ) : string
Résultat string tag name of the panel

onPreRender() public méthode

This method overrides parent implementation.
public onPreRender ( $writer )

processText() public méthode

This method is required by the parent class.
public processText ( $text ) : string
Résultat string the processed text result

registerStyleSheet() protected méthode

Registers the stylesheet for presentation.
protected registerStyleSheet ( )

render() public méthode

public render ( $writer )

setEnableCopyCode() public méthode

public setEnableCopyCode ( $value )

setLanguage() public méthode

public setLanguage ( $value )

setLineNumberStyle() public méthode

public setLineNumberStyle ( $value )

setShowLineNumbers() public méthode

public setShowLineNumbers ( $value )

setTabSize() public méthode

public setTabSize ( $value )