Class Dwoo_Filter_html_format

Description

Formats any html output (must be valid xml where every tag opened is closed) using a single tab for indenting. 'pre' and other whitespace sensitive tags should not be affected.

It is not recommended to use this on every template if you render multiple templates per page, you should only use it once on the main page template so that everything is formatted in one pass.

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

This file is released under the LGPL "GNU Lesser General Public License" More information can be found here: http://www.gnu.org/copyleft/lesser.html

Located in /plugins/builtin/filters/html_format.php (line 28)

Dwoo_Filter
   |
   --Dwoo_Filter_html_format
Variable Summary
static string $lastCallAdd
static int $tabCount
Method Summary
static string closeTag (string $tag, string $add, string $whitespace)
static string openTag (string $tag, string $add, string $whitespace)
static string singleTag (string $tag, string $add,  $whitespace)
static string tagDispatcher (array $input)
string process (string $input, Dwoo $dwoo)
Variables
static string $lastCallAdd = '' (line 42)

stores the additional data (following a tag) of the last call to open/close/singleTag

  • access: protected
static int $tabCount = -1 (line 35)

tab count to auto-indent the source

  • access: protected

Inherited Variables

Inherited from Dwoo_Filter

Dwoo_Filter::$dwoo
Methods
static closeTag (line 129)

returns a closing tag and removes a tab from the auto indenting

  • access: protected
static string closeTag (string $tag, string $add, string $whitespace)
  • string $tag: content of the tag
  • string $add: additional data (anything before the following tag)
  • string $whitespace: white space between the tag and the additional data
static openTag (line 97)

returns an open tag and adds a tab into the auto indenting

  • access: protected
static string openTag (string $tag, string $add, string $whitespace)
  • string $tag: content of the tag
  • string $add: additional data (anything before the following tag)
  • string $whitespace: white space between the tag and the additional data
static singleTag (line 156)

returns a single tag with auto indenting

  • access: protected
static string singleTag (string $tag, string $add,  $whitespace)
  • string $tag: content of the tag
  • string $add: additional data (anything before the following tag)
  • $whitespace
static tagDispatcher (line 71)

helper function for format()'s preg_replace call

  • return: the indented tag
  • access: protected
static string tagDispatcher (array $input)
  • array $input: array of matches (1=>tag, 2=>whitespace(optional), 3=>additional non-html content)
process (line 55)

formats the input using the singleTag/closeTag/openTag functions

It is auto indenting the whole code, excluding <textarea>,

  • return: formatted xhtml
  • access: public
string process (string $input, Dwoo $dwoo)
  • Dwoo $dwoo: the dwoo instance rendering this
  • string $input: the xhtml to format

Redefinition of:
Dwoo_Filter::process()
processes the input and returns it filtered

Inherited Methods

Inherited From Dwoo_Filter

Dwoo_Filter::__construct()
Dwoo_Filter::process()

Documentation generated on Sun, 03 Aug 2008 15:12:37 +0200 by phpDocumentor 1.4.0