Class modParser

Description

Represents the MODx parser responsible for processing MODx tags.

This class encapsulates all of the functions for collecting and evaluating element tags embedded in text content.

Located in /model/modx/modparser.class.php (line 30)


	
			
Direct descendents
Class Description
 class modParser095 An extension of the MODx parser to support legacy MODx tags.
Variable Summary
 mixed $modx
Method Summary
 modParser __construct ( &$modx)
 integer collectElementTags (string $origContent,  &$matches, [string $prefix = '[['], [string $suffix = ']]'])
 string loadFromCache (string $tag)
 void mergeTagOutput ( $tagMap,  &$content, string $content)
 array parseProperties (string $propSource)
 void parsePropertyString (string $string, [boolean $valuesOnly = false])
 void processElementTags (string $parentTag, string &$content, [boolean $processUncacheable = false], [boolean $removeUnprocessed = false], [string $prefix = "[["], [string $suffix = "]]"], [array $tokens = array ()], [integer $depth = 0])
 mixed processTag (string $tag, [ $processUncacheable = true])
 string realname (string $unfiltered)
 string _XType (string $type)
Variables
mixed $modx = null (line 31)
  • access: public
Methods
Constructor __construct (line 33)
modParser __construct ( &$modx)
collectElementTags (line 49)

Collects element tags in a string and injects them into an array.

  • return: The number of tags collected from the content.
  • access: public
integer collectElementTags (string $origContent,  &$matches, [string $prefix = '[['], [string $suffix = ']]'])
  • string $origContent: The content to collect tags from.
  • array &$matches: An array in which the collected tags will be stored (by reference)
  • string $prefix: The characters that define the start of a tag (default= "[[").
  • string $suffix: The characters that define the end of a tag (default= "]]").
loadFromCache (line 454)

Loads output cached by complete tag signature from the elementCache.

  • return: The cached output from the element instance.
  • access: public
  • uses: modX::$_elementCache - Stores all cacheable content from processed elements.
string loadFromCache (string $tag)
  • string $tag: tag The tag signature representing the element instance.
mergeTagOutput (line 191)

Merges processed tag output into provided content string.

  • access: public
void mergeTagOutput ( $tagMap,  &$content, string $content)
  • array $tagMap: An array with full tags as keys and processed output as the values.
  • string $content: The content to merge the tag output with (passed by reference).
  • &$content
parseProperties (line 205)

Parses an element/tag property string or array definition.

  • return: An associative array of property values parsed from the property string or array definition.
  • access: public
array parseProperties (string $propSource)
  • string $propSource: A valid property string or array source to parse.
parsePropertyString (line 230)

Parses an element/tag property string and returns an array of properties.

  • access: public
void parsePropertyString (string $string, [boolean $valuesOnly = false])
  • string $string: The property string to parse.
  • boolean $valuesOnly: Indicates only the property value should be returned.
processElementTags (line 138)

Collects and processes any set of tags as defined by a prefix and suffix.

  • access: public
void processElementTags (string $parentTag, string &$content, [boolean $processUncacheable = false], [boolean $removeUnprocessed = false], [string $prefix = "[["], [string $suffix = "]]"], [array $tokens = array ()], [integer $depth = 0])
  • string $parentTag: The tag representing the element processing this tag. Pass an empty string to allow parsing without this recursion check.
  • string &$content: The content to process and act on (by reference).
  • boolean $processUncacheable: Determines if noncacheable tags are to be processed (default= false).
  • boolean $removeUnprocessed: Determines if unprocessed tags should be left in place in the content, or stripped out (default= false).
  • string $prefix: The characters that define the start of a tag (default= "[[").
  • string $suffix: The characters that define the end of a tag (default= "]]").
  • array $tokens: Indicates that the parser should only process tags with the tokens included in this array.
  • integer $depth: The maximum iterations to recursively process tags returned by prior passes, 0 by default.

Redefined in descendants as:
processTag (line 324)

Processes a modElement tag and returns the result.

  • return: The output of the processed element represented by the specified tag.
  • access: public
mixed processTag (string $tag, [ $processUncacheable = true])
  • string $tag: A full tag string parsed from content.
  • $processUncacheable
realname (line 433)

Gets the real name of an element containing filter modifiers.

  • return: The name minus any filter modifiers.
  • access: public
string realname (string $unfiltered)
  • string $unfiltered: The unfiltered name of a modElement.
_XType (line 291)

Converts legacy property string types to xtypes.

  • return: A valid xtype.
  • access: protected
string _XType (string $type)
  • string $type: A property type string.

Documentation generated on Fri, 17 Jun 2011 10:03:42 -0600 by phpDocumentor 1.4.3