HTML_BBCodeParser
[ class tree: HTML_BBCodeParser ] [ index: HTML_BBCodeParser ] [ all elements ]

Class: HTML_BBCodeParser

Source Location: /Text_Wiki_BBCode-0.0.4/doc/BBCodeParser.php

Class Overview

Text_Wiki
   |
   --Text_Wiki_BBCode
      |
      --HTML_BBCodeParser

Base HTML_BBCodeParser class to transform BBCode in XHTML


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005 bertrand Gugger

Methods


Inherited Variables

Inherited Methods

Class: Text_Wiki_BBCode

Text_Wiki_BBCode::Text_Wiki_BBCode()
Constructor: just adds the path to BBCode rules

Class Details

[line 66]
Base HTML_BBCodeParser class to transform BBCode in XHTML

This is a parser to replace UBB style tags with their xhtml equivalents. It's the refundation of the class using the Text_Wiki transform engine

Usage: $parser = new HTML_BBCodeParser(); $parser->setText('normal [b]bold[/b] and normal again'); $parser->parse(); echo $parser->getParsed(); or: $parser = new HTML_BBCodeParser(); echo $parser->qparse('normal [b]bold[/b] and normal again'); or: echo HTML_BBCodeParser::staticQparse('normal [b]bold[/b] and normal again');

Setting the options from the ini file: $config = parse_ini_file('BBCodeParser.ini', true); $options = &PEAR::getStaticProperty('HTML_BBCodeParser', '_options'); $options = $config['HTML_BBCodeParser']; unset($options);



[ Top ]


Method Detail

HTML_BBCodeParser (Constructor)   [line 119]

none HTML_BBCodeParser( [mixed $options = array()])

Constructor, initialises the options and filters

Sets the private variable _options with base options defined with &PEAR::getStaticProperty(), overwriting them with (if present) the argument to this method. Then it sets the extra options to properly escape the tag characters in preg_replace() etc. The set options are then stored back with &PEAR::getStaticProperty(), so that the filter classes can use them. All the filters in the options are initialised and their defined tags are copied into the private variable _definedTags.


Parameters:

mixed   $options   —  array or string options or ini file to use, can be left out

[ Top ]

filtersToRules   [line 295]

array filtersToRules( [mixed $filters = array()])

Sets rules list from Filters (groups of rules)
  • Return: the corresponding rules
  • Access: public

Parameters:

mixed   $filters   —  filters to set as a comma separated string or array

[ Top ]

getParsed   [line 369]

string getParsed( )

Gets the parsed text from the object

[ Top ]

getPreparsed   [line 355]

string getPreparsed( )

Gets the preparsed text from the object
  • Return: the text set in the object
  • Author: Stijn de Reede <sjr@gmx.co.uk>
  • See: $_preparsed
  • See: _preparse()
  • Access: public

[ Top ]

getText   [line 341]

string getText( )

Gets the unparsed text from the object

[ Top ]

parse   [line 383]

none parse( [string $text = null])

Parses the text set in the object
  • See: Text_Wiki::render()
  • See: Text_Wiki::parse()
  • Access: public

Parameters:

string   $text   —  : if set, that's a call to the parent Text_Wiki::parse()

[ Top ]

parseIniFile   [line 222]

array parseIniFile( [string $iniFile = 'BBCodeParser.ini'])

Parse configuration file to set an option array
  • Return: the corresponding options as a tree general|parse|render|format*Format*Rule
  • Access: public

Parameters:

string   $iniFile   —  the configuration file name (default 'BBCodeParser.ini')

[ Top ]

pruneOptions   [line 199]

array pruneOptions( &$options, string $iniFile)

Prune (unset) empty arrays in options
  • Return: the corresponding options as a tree array general|Parse|Render*Format*Rule
  • Access: public

Parameters:

string   $iniFile   —  the configuration file name (default 'BBCodeParser.ini')
   &$options   — 

[ Top ]

qparse   [line 403]

none qparse( $str)

Quick method to do setText(), parse() and getParsed at once

Parameters:

   $str   — 

[ Top ]

setText   [line 327]

none setText( string $str)

Sets text in the object to be parsed

Parameters:

string   $str   —  the text to set in the object

[ Top ]

staticQparse   [line 419]

none staticQparse( $str)

Quick static method to do setText(), parse() and getParsed at once

Parameters:

   $str   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:50:56 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.