Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • ActionActiveForm
  • ActionActiveFormBase
  • CActiveForm
  • CalendarEventActiveForm
  • CallActiveForm
  • CClipWidget
  • CContentDecorator
  • CFilterWidget
  • CFlexWidget
  • CHtmlPurifier
  • CInputWidget
  • CMarkdown
  • CMaskedTextField
  • CMultiFileUpload
  • COutputCache
  • COutputProcessor
  • CStarRating
  • CTabView
  • CTextHighlighter
  • CTreeView
  • CWidget
  • EventActiveForm
  • MobileActiveForm
  • NoteActiveForm
  • TimeActiveForm
  • X2ActiveForm
  • X2StarRating
  • Overview
  • Package
  • Class
  • Tree

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
Extended by CBaseController
Extended by CWidget
Extended by CFilterWidget implements IFilter
Extended by COutputProcessor
Extended by CTextHighlighter
Package: system\web\widgets
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
Methods summary
public
# processOutput( string $output )

Processes the captured output. This method highlights the output according to the syntax of the specified CTextHighlighter::$language.

Processes the captured output. This method highlights the output according to the syntax of the specified CTextHighlighter::$language.

Parameters

$output
string
$output the captured output to be processed

Overrides

COutputProcessor::processOutput()
public string
# highlight( string $content )

Highlights the content by the syntax of the specified language.

Highlights the content by the syntax of the specified language.

Parameters

$content
string
$content the content to be highlighted.

Returns

string
the highlighted content
public
# registerClientScript( )

Registers the needed CSS and JavaScript.

Registers the needed CSS and JavaScript.

public static
# registerCssFile( string $url = null )

Registers the needed CSS file.

Registers the needed CSS file.

Parameters

$url
string
$url the CSS URL. If null, a default CSS URL will be used.
Methods inherited from COutputProcessor
init(), onProcessOutput(), run()
Methods inherited from CFilterWidget
__construct(), filter(), getIsFilter()
Methods inherited from CWidget
actions(), getController(), getId(), getOwner(), getViewFile(), getViewPath(), render(), setId()
Methods inherited from CBaseController
beginCache(), beginClip(), beginContent(), beginWidget(), createWidget(), endCache(), endClip(), endContent(), endWidget(), renderFile(), renderInternal(), widget()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
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.

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.

whether to show line numbers in the highlighted result. Defaults to false.

See

CTextHighlighter::$lineNumberStyle
public string $lineNumberStyle 'list'
#

the style of line number display. It can be either 'list' or 'table'. Defaults to 'list'.

the style of line number display. It can be either 'list' or 'table'. Defaults to 'list'.

See

CTextHighlighter::$showLineNumbers
public integer $tabSize 4
#

tab size. Defaults to 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.

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.

the HTML attributes to be applied to the container element. The highlighted content is contained in a DIV element.

Properties inherited from CFilterWidget
$stopAction
Properties inherited from CWidget
$actionPrefix, $skin
Magic properties inherited from CFilterWidget
$isFilter
Magic properties inherited from CWidget
$controller, $id, $owner, $viewPath
API documentation generated by ApiGen 2.8.0