## Class TTextHighlighter

Description

TTextHighlighter class.

TTextHighlighter does syntax highlighting its body content, including static text and rendering results of child controls. You can set Language to specify what kind of syntax the body content is. Currently, TTextHighlighter supports the following languages: 'php','prado','css','html','javascript' and 'xml', where 'prado' refers to PRADO template syntax. By setting ShowLineNumbers to true, the highlighted result may be shown with line numbers.

- since: 3.0
- version: $Revision: $ $Date: $
- author: Wei Zhuo<weizhuo[at]gmail[dot]com>

Located in /Web/UI/WebControls/TTextHighlighter.php (line 35)

    TComponent
       |
       --TApplicationComponent
          |
          --TControl
             |
             --TWebControl
                |
                --TTextProcessor
                   |
                   --TTextHighlighter

Direct descendents

Class | Description
--- | ---
TMarkdown | TMarkdown class

Method Summary
boolean getEnableCopyCode ()
string getHeaderTemplate ()
string getLanguage ()
boolean getShowLineNumbers ()
string getTagName ()
void onPreRender (THtmlWriter $writer)
string processText (string $text)
void registerHighlightScripts ()
void setEnableCopyCode (boolean $value)
void setLanguage (string $value)
void setShowLineNumbers (boolean $value)
Methods
getEnableCopyCode (line 83)

- return: true will show "Copy Code" link. Defaults to false.
- access: public

boolean getEnableCopyCode ()
getHeaderTemplate (line 146)

- return: header template with "Copy code" link.
- access: protected

string getHeaderTemplate ()
getLanguage (line 48)

- return: language whose syntax is to be used for highlighting. Defaults to 'php'.
- access: public

string getLanguage ()
getShowLineNumbers (line 67)

- return: whether to show line numbers in the highlighted result.
- access: public

boolean getShowLineNumbers ()
getTagName (line 40)

- return: tag name of the panel
- access: protected

string getTagName ()

Redefinition of:

TWebControl::getTagName()
  Returns the tag name used for this control.

onPreRender (line 101)

Registers css style for the highlighted result.

This method overrides parent implementation.

- access: public

void onPreRender (THtmlWriter $writer)

- THtmlWriter $writer: writer

Redefinition of:

TControl::onPreRender()
  This method is invoked when the control enters 'OnPreRender' stage.

processText (line 131)

Processes a text string.

This method is required by the parent class.

- return: the processed text result
- access: public

string processText (string $text)

- string $text: text string to be processed

Redefinition of:

TTextProcessor::processText()
  Processes a text string.

Redefined in descendants as:

- TMarkdown::processText() : Processes a text string.

registerHighlightScripts (line 111)

Register CSS stylesheet file and javascript file.

- access: protected
- throws: TConfigurationException if highlight.css file cannot be found

void registerHighlightScripts ()
setEnableCopyCode (line 91)

- access: public

void setEnableCopyCode (boolean $value)

- boolean $value: true to show the "Copy Code" link.

setLanguage (line 59)

- access: public

void setLanguage (string $value)

- string $value: language whose syntax is to be used for highlighting. Valid values are those file names (without suffix) that are contained in '3rdParty/geshi/geshi' (e.g. 'php','prado','css','html','javascript', 'xml'.)

setShowLineNumbers (line 75)

- access: public

void setShowLineNumbers (boolean $value)

- boolean $value: whether to show line numbers in the highlighted result.

#### Inherited Methods

Inherited From TTextProcessor

> TTextProcessor::addParsedObject()
> TTextProcessor::getText()
> TTextProcessor::processText()
> TTextProcessor::renderContents()
> TTextProcessor::setText()

Inherited From TWebControl

> TWebControl::addAttributesToRender()
> TWebControl::copyBaseAttributes()
> TWebControl::createStyle()
> TWebControl::getAccessKey()
> TWebControl::getBackColor()
> TWebControl::getBorderColor()
> TWebControl::getBorderStyle()
> TWebControl::getBorderWidth()
> TWebControl::getCssClass()
> TWebControl::getFont()
> TWebControl::getForeColor()
> TWebControl::getHasStyle()
> TWebControl::getHeight()
> TWebControl::getStyle()
> TWebControl::getTabIndex()
> TWebControl::getTagName()
> TWebControl::getToolTip()
> TWebControl::getWidth()
> TWebControl::render()
> TWebControl::renderBeginTag()
> TWebControl::renderContents()
> TWebControl::renderEndTag()
> TWebControl::setAccessKey()
> TWebControl::setBackColor()
> TWebControl::setBorderColor()
> TWebControl::setBorderStyle()
> TWebControl::setBorderWidth()
> TWebControl::setCssClass()
> TWebControl::setForeColor()
> TWebControl::setHeight()
> TWebControl::setStyle()
> TWebControl::setTabIndex()
> TWebControl::setToolTip()
> TWebControl::setWidth()

Inherited From TControl

> TControl::__construct()
> TControl::addedControl()
> TControl::addParsedObject()
> TControl::applyStyleSheetSkin()
> TControl::autoBindProperty()
> TControl::autoDataBindProperties()
> TControl::bindProperty()
> TControl::broadcastEvent()
> TControl::broadcastEventInternal()
> TControl::bubbleEvent()
> TControl::clearChildState()
> TControl::clearControlState()
> TControl::clearNamingContainer()
> TControl::clearViewState()
> TControl::createChildControls()
> TControl::createControlCollection()
> TControl::createdOnTemplate()
> TControl::dataBind()
> TControl::dataBindChildren()
> TControl::dataBindProperties()
> TControl::ensureChildControls()
> TControl::findControl()
> TControl::findControlsByID()
> TControl::findControlsByType()
> TControl::focus()
> TControl::getAdapter()
> TControl::getAllowChildControls()
> TControl::getAttribute()
> TControl::getAttributes()
> TControl::getChildControlsCreated()
> TControl::getClientID()
> TControl::getControls()
> TControl::getControlStage()
> TControl::getControlState()
> TControl::getEnabled()
> TControl::getEnableTheming()
> TControl::getEnableViewState()
> TControl::getHasAdapter()
> TControl::getHasAttributes()
> TControl::getHasControls()
> TControl::getID()
> TControl::getNamingContainer()
> TControl::getPage()
> TControl::getParent()
> TControl::getRegisteredObject()
> TControl::getSkinID()
> TControl::getSourceTemplateControl()
> TControl::getTemplateControl()
> TControl::getUniqueID()
> TControl::getViewState()
> TControl::getVisible()
> TControl::hasAttribute()
> TControl::initRecursive()
> TControl::isDescendentOf()
> TControl::isObjectRegistered()
> TControl::loadRecursive()
> TControl::loadState()
> TControl::loadStateRecursive()
> TControl::onDataBinding()
> TControl::onInit()
> TControl::onLoad()
> TControl::onPreRender()
> TControl::onUnload()
> TControl::preRenderRecursive()
> TControl::raiseBubbleEvent()
> TControl::registerObject()
> TControl::removeAttribute()
> TControl::removedControl()
> TControl::render()
> TControl::renderChildren()
> TControl::renderControl()
> TControl::saveState()
> TControl::saveStateRecursive()
> TControl::setAdapter()
> TControl::setAttribute()
> TControl::setChildControlsCreated()
> TControl::setControlStage()
> TControl::setControlState()
> TControl::setEnabled()
> TControl::setEnableTheming()
> TControl::setEnableViewState()
> TControl::setID()
> TControl::setPage()
> TControl::setSkinID()
> TControl::setTemplateControl()
> TControl::setViewState()
> TControl::setVisible()
> TControl::traverseChildControls()
> TControl::unbindProperty()
> TControl::unloadRecursive()
> TControl::unregisterObject()
> TControl::__get()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Class Constants

#### Inherited Constants

Inherited from TControl

Documentation generated on Sun, 04 Jun 2006 19:00:32 -0400 by phpDocumentor 1.3.0RC4