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

  • Text_Highlighter
  • Text_Highlighter_ABAP
  • Text_Highlighter_CPP
  • Text_Highlighter_CSS
  • Text_Highlighter_DIFF
  • Text_Highlighter_DTD
  • Text_Highlighter_Generator
  • Text_Highlighter_HTML
  • Text_Highlighter_JAVA
  • Text_Highlighter_JAVASCRIPT
  • Text_Highlighter_MYSQL
  • Text_Highlighter_PERL
  • Text_Highlighter_PHP
  • Text_Highlighter_PYTHON
  • Text_Highlighter_Renderer
  • Text_Highlighter_Renderer_Array
  • Text_Highlighter_Renderer_BB
  • Text_Highlighter_Renderer_Console
  • Text_Highlighter_Renderer_Html
  • Text_Highlighter_Renderer_HtmlTags
  • Text_Highlighter_Renderer_JSON
  • Text_Highlighter_Renderer_XML
  • Text_Highlighter_RUBY
  • Text_Highlighter_SH
  • Text_Highlighter_SQL
  • Text_Highlighter_VBSCRIPT
  • Text_Highlighter_XML
  • Overview
  • Package
  • Class
  • Tree

Class Text_Highlighter_Renderer_Html

HTML renderer

Elements of $options argument of constructor (each being optional):

  • 'numbers' - Line numbering style 0 or HL_NUMBERS_TABLE or HL_NUMBERS_UL or HL_NUMBERS_OL
  • 'numbers_start' - starting number for numbered lines
  • 'tabsize' - Tab size
  • 'style_map' - Mapping of keywords to formatting rules using inline styles
  • 'class_map' - Mapping of keywords to formatting rules using class names
  • 'doclinks' - array that has keys "url", "target" and "elements", used for generating links to online documentation
  • 'use_language' - class names will be prefixed with language, like "php-reserved" or "css-code"

Example of setting documentation links: $options['doclinks'] = array( 'url' => 'http://php.net/%s', 'target' => '_blank', 'elements' => array('reserved', 'identifier') );

Example of setting class names map: $options['class_map'] = array( 'main' => 'my-main', 'table' => 'my-table', 'gutter' => 'my-gutter', 'brackets' => 'my-brackets', 'builtin' => 'my-builtin', 'code' => 'my-code', 'comment' => 'my-comment', 'default' => 'my-default', 'identifier' => 'my-identifier', 'inlinedoc' => 'my-inlinedoc', 'inlinetags' => 'my-inlinetags', 'mlcomment' => 'my-mlcomment', 'number' => 'my-number', 'quotes' => 'my-quotes', 'reserved' => 'my-reserved', 'special' => 'my-special', 'string' => 'my-string', 'url' => 'my-url', 'var' => 'my-var', );

Example of setting styles mapping: $options['style_map'] = array( 'main' => 'color: black', 'table' => 'border: 1px solid black', 'gutter' => 'background-color: yellow', 'brackets' => 'color: blue', 'builtin' => 'color: red', 'code' => 'color: green', 'comment' => 'color: orange', // .... );

Text_Highlighter_Renderer
Extended by Text_Highlighter_Renderer_Array
Extended by Text_Highlighter_Renderer_Html
Package: Text\Highlighter
Category: Text
Copyright: 2004-2006 Andrey Demenev
License: PHP License
Author: Andrey Demenev <demenev@gmail.com>
Version: Release: 0.7.1
Link: http://pear.php.net/package/Text_Highlighter
Located at x2engine/framework/vendors/TextHighlighter/Text/Highlighter/Renderer/Html.php
Methods summary
public
# reset( )

Resets renderer state

Resets renderer state

Overrides

Text_Highlighter_Renderer_Array::reset()
public
# _getFullClassName( string $class )

Given a CSS class name, returns the class name with language name prepended, if necessary

Given a CSS class name, returns the class name with language name prepended, if necessary

Parameters

$class
string
$class Token class

Overrides

Text_Highlighter_Renderer_Array::_getFullClassName()
public
# finalize( )

Signals that no more tokens are available

Signals that no more tokens are available

Overrides

Text_Highlighter_Renderer::finalize()
public string
# _decorate( string $content, mixed $key = false )

Provides additional formatting to a keyword

Provides additional formatting to a keyword

Parameters

$content
string
$content Keyword
$key

Returns

string
Keyword with additional formatting
public string
# _getStyling( string $class, mixed $span_tag = true )

Returns <span class="php-keyword1">class</span> and/or style attribute, optionally enclosed in a span tag

Returns <span class="php-keyword1">class</span> and/or style attribute, optionally enclosed in a span tag

Parameters

$class
string
$class Class name
$span_tag

Returns

string
span tag or just a <span class="php-keyword1">class</span> and/or style attributes

Paran

boolean $span_tag Whether or not to return styling attributes in a &gt;span&lt; tag
Methods inherited from Text_Highlighter_Renderer_Array
acceptToken(), getOutput(), preprocess()
Methods inherited from Text_Highlighter_Renderer
__construct(), setCurrentLanguage()
Properties summary
public integer $_numbers 0
#

Line numbering style

Line numbering style

public integer $_numbers_start 0
#

For numberered lines - where to start

For numberered lines - where to start

public integer $_tabsize 4
#

Tab size

Tab size

public string $_output ''
#

Highlighted code

Highlighted code

public array $_style_map array()
#

Mapping of keywords to formatting rules using inline styles

Mapping of keywords to formatting rules using inline styles

public array $_class_map array( 'main' => 'hl-main', 'table' => 'hl-table', 'gutter' => 'hl-gutter', 'brackets' => 'hl-brackets', 'builtin' => 'hl-builtin', 'code' => 'hl-code', 'comment' => 'hl-comment', 'default' => 'hl-default', 'identifier' => 'hl-identifier', 'inlinedoc' => 'hl-inlinedoc', 'inlinetags' => 'hl-inlinetags', 'mlcomment' => 'hl-mlcomment', 'number' => 'hl-number', 'quotes' => 'hl-quotes', 'reserved' => 'hl-reserved', 'special' => 'hl-special', 'string' => 'hl-string', 'url' => 'hl-url', 'var' => 'hl-var', )
#

Mapping of keywords to formatting rules using class names

Mapping of keywords to formatting rules using class names

public array $_doclinks array()
#

Setup for links to online documentation

Setup for links to online documentation

This is an array with keys:

  • url, ex. http://php.net/%s
  • target, ex. _blank, default - no target
  • elements, default is <span class="php-keyword1">array</span>(<span class="php-quote">'reserved'</span>, <span class="php-quote">'identifier'</span>)
Properties inherited from Text_Highlighter_Renderer_Array
$_enumerated, $_htmlspecialchars
Properties inherited from Text_Highlighter_Renderer
$_language, $_options
API documentation generated by ApiGen 2.8.0