core/model/modx/modparser.class.php

Show: inherited
Table of Contents

MODX Revolution

Copyright 2006-2012 by MODX, LLC. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Package
modx  

\modFieldTag

Package: modx

Tag representing a modResource field from the current MODX resource.

[[*content]] Represents the content field from modResource.

Parent(s)
\modTag
Uses
\modX::$resource  

Properties

Propertypublicboolean  $_cacheable= 'true'
inherited

Whether or not this tag is marked as cacheable

Inherited from: \modTag::$$_cacheable
Default valuetrueDetails
Type
boolean
Inherited_from
\modTag::$$_cacheable  
Propertypublicstring  $_content= 'null'
inherited

The content of the tag

Inherited from: \modTag::$$_content
Default valuenullDetails
Type
string
Inherited_from
\modTag::$$_content  
Propertypublicarray  $_fields= 'array( 'name' => '', 'properties' => '' )'
inherited

Fields on the tag

Inherited from: \modTag::$$_fields
Default valuearray( 'name' => '', 'properties' => '' )Details
Type
array
Inherited_from
\modTag::$$_fields  
Propertypublicarray  $_filters= 'array('input' => null, 'output' => null)'
inherited

Any output/input filters on this tag

Inherited from: \modTag::$$_filters
Default valuearray('input' => null, 'output' => null)Details
Type
array
Inherited_from
\modTag::$$_filters  
Propertypublicstring  $_output= ''''
inherited

The processed output of the tag

Inherited from: \modTag::$$_output
Default value''Details
Type
string
Inherited_from
\modTag::$$_output  
Propertypublicboolean  $_processed= 'false'
inherited

Whether or not the tag has been processed

Inherited from: \modTag::$$_processed
Default valuefalseDetails
Type
boolean
Inherited_from
\modTag::$$_processed  
Propertypublicarray  $_properties= 'array()'
inherited

The arranged properties array for this tag

Inherited from: \modTag::$$_properties
Default valuearray()Details
Type
array
Inherited_from
\modTag::$$_properties  
Propertypublicstring  $_propertyString= ''''
inherited

Just the isolated properties part of the tag string

Inherited from: \modTag::$$_propertyString
Default value''Details
Type
string
Inherited_from
\modTag::$$_propertyString  
Propertypublicbool  $_result= 'true'
inherited

The result of processing the tag

Inherited from: \modTag::$$_result
Default valuetrueDetails
Type
bool
Inherited_from
\modTag::$$_result  
Propertypublicstring  $_tag= ''''
inherited

The tag string

Inherited from: \modTag::$$_tag
Default value''Details
Type
string
Inherited_from
\modTag::$$_tag  
Propertypublicstring  $_token= ''''
inherited

The tag initial token ($,%,*,etc)

Inherited from: \modTag::$$_token
Default value''Details
Type
string
Inherited_from
\modTag::$$_token  
Propertypublic\modX  $modx= 'null'
inherited

A reference to the modX instance

Inherited from: \modTag::$$modx
Default valuenullDetails
Type
\modX
Inherited_from
\modTag::$$modx  
Propertypublicstring  $name= ''
inherited

The name of the tag

Inherited from: \modTag::$$name
Details
Type
string
Inherited_from
\modTag::$$name  
Propertypublicarray  $properties= ''
inherited

The properties on the tag

Inherited from: \modTag::$$properties
Details
Type
array
Inherited_from
\modTag::$$properties  

Methods

methodpublic__construct( \modX $modx ) : void

Overrides modTag::__construct to set the Field Tag token Set a reference to the modX object, load the name and properties, and instantiate the tag class instance.

Parameters
Name Type Description
$modx \modX

A reference to the modX object

methodpubliccache( ) : void
inherited

Cache the element into the elementCache by tag signature.

Inherited from: \modTag::cache()
Details
See
\modElement::cache()  
methodpublicfilterInput( ) : void
inherited

Apply an input filter to a tag.

Inherited from: \modTag::filterInput()

This is called by default in {@link modTag::process()} after the tag properties have been parsed.

Details
See
\modElement::filterInput()  
methodpublicfilterOutput( ) : void
inherited

Apply an output filter to a tag.

Inherited from: \modTag::filterOutput()

Call this method in your {modTag::process()} implementation when it is appropriate, typically once all processing has been completed, but before any caching takes place.

Details
See
\modElement::filterOutput()  
methodpublicget( string $k ) : mixed
inherited

Generic getter method for modTag attributes.

Inherited from: \modTag::get()
Parameters
Name Type Description
$k string

The field key.

Returns
Type Description
mixed The value of the field or null if it is not set.
Details
See
\xPDOObject::get()  
methodpublicgetContent( array $options = array() ) : string

Get the raw source content of the field.

Parameters
Name Type Description
$options array

An array of options implementations can use to accept language, revision identifiers, or other information to alter the behavior of the method.

Returns
Type Description
string The raw source content for the element.
methodpublicgetInputFilter( ) : \modInputFilter | null
inherited

Get an input filter instance configured for this Element.

Inherited from: \modTag::getInputFilter()
Returns
Type Description
\modInputFilter | null An input filter instance (or null if one cannot be loaded).
methodpublicgetOutputFilter( ) : \modOutputFilter | null
inherited

Get an output filter instance configured for this Element.

Inherited from: \modTag::getOutputFilter()
Returns
Type Description
\modOutputFilter | null An output filter instance (or null if one cannot be loaded).
methodpublicgetProperties( array | string $properties = null ) : array
inherited

Get the properties for this element instance for processing.

Inherited from: \modTag::getProperties()
Parameters
Name Type Description
$properties array | string

An array or string of properties to apply.

Returns
Type Description
array A simple array of properties ready to use for processing.
methodpublicgetPropertySet( string | null $setName = null ) : array | null
inherited

Gets a named property set to use with this modTag instance.

Inherited from: \modTag::getPropertySet()

This function will attempt to extract a setName from the tag name using the @ symbol to delimit the name of the property set. If a setName parameter is provided, the function will override any property set specified in the name by merging both property sets.

Here is an example of an tag using the @ modifier to specify a property set name: [[~TagName@PropertySetName:FilterCommand=FilterModifier? &PropertyKey1=PropertyValue1 &PropertyKey2=PropertyValue2 ]]

Parameters
Name Type Description
$setName string | null

An explicit property set name to search for.

Returns
Type Description
array | null An array of properties or null if no set is found.
methodpublicgetTag( ) : string
inherited

Gets a tag representation of the modTag instance.

Inherited from: \modTag::getTag()
Returns
Type Description
string
methodpublicgetToken( ) : string
inherited

Returns the current token for the tag

Inherited from: \modTag::getToken()
Returns
Type Description
string The token for the tag
methodpublicisCacheable( ) : boolean
inherited

Indicates if the element is cacheable.

Inherited from: \modTag::isCacheable()
Returns
Type Description
boolean True if the element can be stored to or retrieved from the element cache.
methodpublicprocess( array | string $properties = null, string $content = null ) : mixed

Process the modFieldTag and return the output.

Parameters
Name Type Description
$properties array | string

An array of properties or a formatted property string.

$content string

Optional content to use for the element processing.

Returns
Type Description
mixed The result of processing the tag.
methodpublicset( string $k, mixed $v ) : void
inherited

Generic setter method for modTag attributes.

Inherited from: \modTag::set()
Parameters
Name Type Description
$k string

The field key.

$v mixed

The value to assign to the field.

Details
See
\xPDOObject::set()  
methodpublicsetCacheable( boolean $cacheable = true ) : void
inherited

Sets the runtime cacheability of the element.

Inherited from: \modTag::setCacheable()
Parameters
Name Type Description
$cacheable boolean

Indicates the value to set for cacheability of this element.

methodpublicsetContent( string $content, array $options = array() ) : boolean
inherited

Set the raw source content for the tag element.

Inherited from: \modTag::setContent()
Parameters
Name Type Description
$content string

The content to set

$options array

Ignored.

Returns
Type Description
boolean
methodpublicsetProperties( array | string $properties, boolean $merge = false ) : boolean
inherited

Set default properties for this element instance.

Inherited from: \modTag::setProperties()
Parameters
Name Type Description
$properties array | string

A property array or property string.

$merge boolean

Indicates if properties should be merged with existing ones.

Returns
Type Description
boolean true if the properties are set.
methodpublicsetTag( string $tag ) : void
inherited

Setter method for the tag class var.

Inherited from: \modTag::setTag()
Parameters
Name Type Description
$tag string

The tag to use for this element.

methodpublicsetToken( string $token ) : void
inherited

Setter method for the token class var.

Inherited from: \modTag::setToken()
Parameters
Name Type Description
$token string

The token to use for this element tag.

\modLexiconTag

Package: modx

Represents Lexicon tags, for localized strings.

[[%word_or_phase]] Returns the lexicon representation of 'word_or_phrase' for the currently loaded language.

Parent(s)
\modTag

Properties

Propertypublicboolean  $_cacheable= 'true'
inherited

Whether or not this tag is marked as cacheable

Inherited from: \modTag::$$_cacheable
Default valuetrueDetails
Type
boolean
Inherited_from
\modTag::$$_cacheable  
Propertypublicstring  $_content= 'null'
inherited

The content of the tag

Inherited from: \modTag::$$_content
Default valuenullDetails
Type
string
Inherited_from
\modTag::$$_content  
Propertypublicarray  $_fields= 'array( 'name' => '', 'properties' => '' )'
inherited

Fields on the tag

Inherited from: \modTag::$$_fields
Default valuearray( 'name' => '', 'properties' => '' )Details
Type
array
Inherited_from
\modTag::$$_fields  
Propertypublicarray  $_filters= 'array('input' => null, 'output' => null)'
inherited

Any output/input filters on this tag

Inherited from: \modTag::$$_filters
Default valuearray('input' => null, 'output' => null)Details
Type
array
Inherited_from
\modTag::$$_filters  
Propertypublicstring  $_output= ''''
inherited

The processed output of the tag

Inherited from: \modTag::$$_output
Default value''Details
Type
string
Inherited_from
\modTag::$$_output  
Propertypublicboolean  $_processed= 'false'
inherited

Whether or not the tag has been processed

Inherited from: \modTag::$$_processed
Default valuefalseDetails
Type
boolean
Inherited_from
\modTag::$$_processed  
Propertypublicarray  $_properties= 'array()'
inherited

The arranged properties array for this tag

Inherited from: \modTag::$$_properties
Default valuearray()Details
Type
array
Inherited_from
\modTag::$$_properties  
Propertypublicstring  $_propertyString= ''''
inherited

Just the isolated properties part of the tag string

Inherited from: \modTag::$$_propertyString
Default value''Details
Type
string
Inherited_from
\modTag::$$_propertyString  
Propertypublicbool  $_result= 'true'
inherited

The result of processing the tag

Inherited from: \modTag::$$_result
Default valuetrueDetails
Type
bool
Inherited_from
\modTag::$$_result  
Propertypublicstring  $_tag= ''''
inherited

The tag string

Inherited from: \modTag::$$_tag
Default value''Details
Type
string
Inherited_from
\modTag::$$_tag  
Propertypublicstring  $_token= ''''
inherited

The tag initial token ($,%,*,etc)

Inherited from: \modTag::$$_token
Default value''Details
Type
string
Inherited_from
\modTag::$$_token  
Propertypublic\modX  $modx= 'null'
inherited

A reference to the modX instance

Inherited from: \modTag::$$modx
Default valuenullDetails
Type
\modX
Inherited_from
\modTag::$$modx  
Propertypublicstring  $name= ''
inherited

The name of the tag

Inherited from: \modTag::$$name
Details
Type
string
Inherited_from
\modTag::$$name  
Propertypublicarray  $properties= ''
inherited

The properties on the tag

Inherited from: \modTag::$$properties
Details
Type
array
Inherited_from
\modTag::$$properties  

Methods

methodpublic__construct( \modX $modx ) : void

Overrides modTag::__construct to set the Lexicon Tag token Set a reference to the modX object, load the name and properties, and instantiate the tag class instance.

Parameters
Name Type Description
$modx \modX

A reference to the modX object

methodpubliccache( ) : void
inherited

Cache the element into the elementCache by tag signature.

Inherited from: \modTag::cache()
Details
See
\modElement::cache()  
methodpublicfilterInput( ) : void
inherited

Apply an input filter to a tag.

Inherited from: \modTag::filterInput()

This is called by default in {@link modTag::process()} after the tag properties have been parsed.

Details
See
\modElement::filterInput()  
methodpublicfilterOutput( ) : void
inherited

Apply an output filter to a tag.

Inherited from: \modTag::filterOutput()

Call this method in your {modTag::process()} implementation when it is appropriate, typically once all processing has been completed, but before any caching takes place.

Details
See
\modElement::filterOutput()  
methodpublicget( string $k ) : mixed
inherited

Generic getter method for modTag attributes.

Inherited from: \modTag::get()
Parameters
Name Type Description
$k string

The field key.

Returns
Type Description
mixed The value of the field or null if it is not set.
Details
See
\xPDOObject::get()  
methodpublicgetContent( array $options = array() ) : string

Get the raw source content of the link.

Parameters
Name Type Description
$options array

An array of options implementations can use to accept language, revision identifiers, or other information to alter the behavior of the method.

Returns
Type Description
string The raw source content for the element.
methodpublicgetInputFilter( ) : \modInputFilter | null
inherited

Get an input filter instance configured for this Element.

Inherited from: \modTag::getInputFilter()
Returns
Type Description
\modInputFilter | null An input filter instance (or null if one cannot be loaded).
methodpublicgetOutputFilter( ) : \modOutputFilter | null
inherited

Get an output filter instance configured for this Element.

Inherited from: \modTag::getOutputFilter()
Returns
Type Description
\modOutputFilter | null An output filter instance (or null if one cannot be loaded).
methodpublicgetProperties( array | string $properties = null ) : array
inherited

Get the properties for this element instance for processing.

Inherited from: \modTag::getProperties()
Parameters
Name Type Description
$properties array | string

An array or string of properties to apply.

Returns
Type Description
array A simple array of properties ready to use for processing.
methodpublicgetPropertySet( string | null $setName = null ) : array | null
inherited

Gets a named property set to use with this modTag instance.

Inherited from: \modTag::getPropertySet()

This function will attempt to extract a setName from the tag name using the @ symbol to delimit the name of the property set. If a setName parameter is provided, the function will override any property set specified in the name by merging both property sets.

Here is an example of an tag using the @ modifier to specify a property set name: [[~TagName@PropertySetName:FilterCommand=FilterModifier? &PropertyKey1=PropertyValue1 &PropertyKey2=PropertyValue2 ]]

Parameters
Name Type Description
$setName string | null

An explicit property set name to search for.

Returns
Type Description
array | null An array of properties or null if no set is found.
methodpublicgetTag( ) : string
inherited

Gets a tag representation of the modTag instance.

Inherited from: \modTag::getTag()
Returns
Type Description
string
methodpublicgetToken( ) : string
inherited

Returns the current token for the tag

Inherited from: \modTag::getToken()
Returns
Type Description
string The token for the tag
methodpublicisCacheable( ) : boolean
inherited

Indicates if the element is cacheable.

Inherited from: \modTag::isCacheable()
Returns
Type Description
boolean True if the element can be stored to or retrieved from the element cache.
methodpublicprocess( array | string $properties = null, string $content = null ) : mixed

Processes a modLexiconTag, recursively processing nested tags.

Parameters
Name Type Description
$properties array | string

An array of properties or a formatted property string.

$content string

Optional content to use for the element processing.

Returns
Type Description
mixed The result of processing the tag.
methodpublicset( string $k, mixed $v ) : void
inherited

Generic setter method for modTag attributes.

Inherited from: \modTag::set()
Parameters
Name Type Description
$k string

The field key.

$v mixed

The value to assign to the field.

Details
See
\xPDOObject::set()  
methodpublicsetCacheable( boolean $cacheable = true ) : void
inherited

Sets the runtime cacheability of the element.

Inherited from: \modTag::setCacheable()
Parameters
Name Type Description
$cacheable boolean

Indicates the value to set for cacheability of this element.

methodpublicsetContent( string $content, array $options = array() ) : boolean
inherited

Set the raw source content for the tag element.

Inherited from: \modTag::setContent()
Parameters
Name Type Description
$content string

The content to set

$options array

Ignored.

Returns
Type Description
boolean
methodpublicsetProperties( array | string $properties, boolean $merge = false ) : boolean
inherited

Set default properties for this element instance.

Inherited from: \modTag::setProperties()
Parameters
Name Type Description
$properties array | string

A property array or property string.

$merge boolean

Indicates if properties should be merged with existing ones.

Returns
Type Description
boolean true if the properties are set.
methodpublicsetTag( string $tag ) : void
inherited

Setter method for the tag class var.

Inherited from: \modTag::setTag()
Parameters
Name Type Description
$tag string

The tag to use for this element.

methodpublicsetToken( string $token ) : void
inherited

Setter method for the token class var.

Inherited from: \modTag::setToken()
Parameters
Name Type Description
$token string

The token to use for this element tag.

\modLinkTag

Package: modx

Represents link tags.

[[~12]] Creates a URL from the specified resource identifier.

Parent(s)
\modTag

Properties

Propertypublicboolean  $_cacheable= 'true'
inherited

Whether or not this tag is marked as cacheable

Inherited from: \modTag::$$_cacheable
Default valuetrueDetails
Type
boolean
Inherited_from
\modTag::$$_cacheable  
Propertypublicstring  $_content= 'null'
inherited

The content of the tag

Inherited from: \modTag::$$_content
Default valuenullDetails
Type
string
Inherited_from
\modTag::$$_content  
Propertypublicarray  $_fields= 'array( 'name' => '', 'properties' => '' )'
inherited

Fields on the tag

Inherited from: \modTag::$$_fields
Default valuearray( 'name' => '', 'properties' => '' )Details
Type
array
Inherited_from
\modTag::$$_fields  
Propertypublicarray  $_filters= 'array('input' => null, 'output' => null)'
inherited

Any output/input filters on this tag

Inherited from: \modTag::$$_filters
Default valuearray('input' => null, 'output' => null)Details
Type
array
Inherited_from
\modTag::$$_filters  
Propertypublicstring  $_output= ''''
inherited

The processed output of the tag

Inherited from: \modTag::$$_output
Default value''Details
Type
string
Inherited_from
\modTag::$$_output  
Propertypublicboolean  $_processed= 'false'
inherited

Whether or not the tag has been processed

Inherited from: \modTag::$$_processed
Default valuefalseDetails
Type
boolean
Inherited_from
\modTag::$$_processed  
Propertypublicarray  $_properties= 'array()'
inherited

The arranged properties array for this tag

Inherited from: \modTag::$$_properties
Default valuearray()Details
Type
array
Inherited_from
\modTag::$$_properties  
Propertypublicstring  $_propertyString= ''''
inherited

Just the isolated properties part of the tag string

Inherited from: \modTag::$$_propertyString
Default value''Details
Type
string
Inherited_from
\modTag::$$_propertyString  
Propertypublicbool  $_result= 'true'
inherited

The result of processing the tag

Inherited from: \modTag::$$_result
Default valuetrueDetails
Type
bool
Inherited_from
\modTag::$$_result  
Propertypublicstring  $_tag= ''''
inherited

The tag string

Inherited from: \modTag::$$_tag
Default value''Details
Type
string
Inherited_from
\modTag::$$_tag  
Propertypublicstring  $_token= ''''
inherited

The tag initial token ($,%,*,etc)

Inherited from: \modTag::$$_token
Default value''Details
Type
string
Inherited_from
\modTag::$$_token  
Propertypublic\modX  $modx= 'null'
inherited

A reference to the modX instance

Inherited from: \modTag::$$modx
Default valuenullDetails
Type
\modX
Inherited_from
\modTag::$$modx  
Propertypublicstring  $name= ''
inherited

The name of the tag

Inherited from: \modTag::$$name
Details
Type
string
Inherited_from
\modTag::$$name  
Propertypublicarray  $properties= ''
inherited

The properties on the tag

Inherited from: \modTag::$$properties
Details
Type
array
Inherited_from
\modTag::$$properties  

Methods

methodpublic__construct( \modX $modx ) : void
inherited

Set a reference to the modX object, load the name and properties, and instantiate the tag class instance.

Inherited from: \modTag::__construct()
Parameters
Name Type Description
$modx \modX

A reference to the modX object

methodpublic__constructor(  $modx ) : void

Overrides modTag::__construct to set the Link Tag token {@inheritdoc}

Parameters
Name Type Description
$modx
methodpubliccache( ) : void
inherited

Cache the element into the elementCache by tag signature.

Inherited from: \modTag::cache()
Details
See
\modElement::cache()  
methodpublicfilterInput( ) : void
inherited

Apply an input filter to a tag.

Inherited from: \modTag::filterInput()

This is called by default in {@link modTag::process()} after the tag properties have been parsed.

Details
See
\modElement::filterInput()  
methodpublicfilterOutput( ) : void
inherited

Apply an output filter to a tag.

Inherited from: \modTag::filterOutput()

Call this method in your {modTag::process()} implementation when it is appropriate, typically once all processing has been completed, but before any caching takes place.

Details
See
\modElement::filterOutput()  
methodpublicget( string $k ) : mixed
inherited

Generic getter method for modTag attributes.

Inherited from: \modTag::get()
Parameters
Name Type Description
$k string

The field key.

Returns
Type Description
mixed The value of the field or null if it is not set.
Details
See
\xPDOObject::get()  
methodpublicgetContent( array $options = array() ) : string
inherited

Get the raw source content of the tag element.

Inherited from: \modTag::getContent()
Parameters
Name Type Description
$options array

An array of options implementations can use to accept language, revision identifiers, or other information to alter the behavior of the method.

Returns
Type Description
string The raw source content for the element.
methodpublicgetInputFilter( ) : \modInputFilter | null
inherited

Get an input filter instance configured for this Element.

Inherited from: \modTag::getInputFilter()
Returns
Type Description
\modInputFilter | null An input filter instance (or null if one cannot be loaded).
methodpublicgetOutputFilter( ) : \modOutputFilter | null
inherited

Get an output filter instance configured for this Element.

Inherited from: \modTag::getOutputFilter()
Returns
Type Description
\modOutputFilter | null An output filter instance (or null if one cannot be loaded).
methodpublicgetProperties( array | string $properties = null ) : array
inherited

Get the properties for this element instance for processing.

Inherited from: \modTag::getProperties()
Parameters
Name Type Description
$properties array | string

An array or string of properties to apply.

Returns
Type Description
array A simple array of properties ready to use for processing.
methodpublicgetPropertySet( string | null $setName = null ) : array | null
inherited

Gets a named property set to use with this modTag instance.

Inherited from: \modTag::getPropertySet()

This function will attempt to extract a setName from the tag name using the @ symbol to delimit the name of the property set. If a setName parameter is provided, the function will override any property set specified in the name by merging both property sets.

Here is an example of an tag using the @ modifier to specify a property set name: [[~TagName@PropertySetName:FilterCommand=FilterModifier? &PropertyKey1=PropertyValue1 &PropertyKey2=PropertyValue2 ]]

Parameters
Name Type Description
$setName string | null

An explicit property set name to search for.

Returns
Type Description
array | null An array of properties or null if no set is found.
methodpublicgetTag( ) : string
inherited

Gets a tag representation of the modTag instance.

Inherited from: \modTag::getTag()
Returns
Type Description
string
methodpublicgetToken( ) : string
inherited

Returns the current token for the tag

Inherited from: \modTag::getToken()
Returns
Type Description
string The token for the tag
methodpublicisCacheable( ) : boolean
inherited

Indicates if the element is cacheable.

Inherited from: \modTag::isCacheable()
Returns
Type Description
boolean True if the element can be stored to or retrieved from the element cache.
methodpublicprocess( array | string $properties = null, string $content = null ) : mixed

Processes the modLinkTag, recursively processing nested tags.

Parameters
Name Type Description
$properties array | string

An array of properties or a formatted property string.

$content string

Optional content to use for the element processing.

Returns
Type Description
mixed The result of processing the tag.
methodpublicset( string $k, mixed $v ) : void
inherited

Generic setter method for modTag attributes.

Inherited from: \modTag::set()
Parameters
Name Type Description
$k string

The field key.

$v mixed

The value to assign to the field.

Details
See
\xPDOObject::set()  
methodpublicsetCacheable( boolean $cacheable = true ) : void
inherited

Sets the runtime cacheability of the element.

Inherited from: \modTag::setCacheable()
Parameters
Name Type Description
$cacheable boolean

Indicates the value to set for cacheability of this element.

methodpublicsetContent( string $content, array $options = array() ) : boolean
inherited

Set the raw source content for the tag element.

Inherited from: \modTag::setContent()
Parameters
Name Type Description
$content string

The content to set

$options array

Ignored.

Returns
Type Description
boolean
methodpublicsetProperties( array | string $properties, boolean $merge = false ) : boolean
inherited

Set default properties for this element instance.

Inherited from: \modTag::setProperties()
Parameters
Name Type Description
$properties array | string

A property array or property string.

$merge boolean

Indicates if properties should be merged with existing ones.

Returns
Type Description
boolean true if the properties are set.
methodpublicsetTag( string $tag ) : void
inherited

Setter method for the tag class var.

Inherited from: \modTag::setTag()
Parameters
Name Type Description
$tag string

The tag to use for this element.

methodpublicsetToken( string $token ) : void
inherited

Setter method for the token class var.

Inherited from: \modTag::setToken()
Parameters
Name Type Description
$token string

The token to use for this element tag.

\modParser

Package: modx

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.

Children
\modParser095

Properties

Propertyprotectedbool  $_processingTag= 'false'

If the parser is currently processing a tag

Default valuefalseDetails
Type
bool
Propertyprotectedbool  $_processingUncacheable= 'false'

If the parser is currently processing an uncacheable tag

Default valuefalseDetails
Type
bool
Propertyprotectedbool  $_removingUnprocessed= 'false'

If the parser is currently removing all unprocessed tags

Default valuefalseDetails
Type
bool
Propertypublic\modX  $modx= 'null'

A reference to the modX instance

Default valuenullDetails
Type
\modX

Methods

methodprotected_XType( string $type ) : string

Converts legacy property string types to xtypes.

Parameters
Name Type Description
$type string

A property type string.

Returns
Type Description
string A valid xtype.
Details
Access
protected  
methodpublic__construct( \xPDO $modx ) : void

Parameters
Name Type Description
$modx \xPDO

A reference to the modX|xPDO instance

methodpubliccollectElementTags( string $origContent, array $matches, string $prefix = '[[', string $suffix = ']]' ) : integer

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

Parameters
Name Type Description
$origContent string

The content to collect tags from.

$matches array

&$matches An array in which the collected tags will be stored (by reference)

$prefix string

The characters that define the start of a tag (default= "[[").

$suffix string

The characters that define the end of a tag (default= "]]").

Returns
Type Description
integer The number of tags collected from the content.
methodpublicgetElement( string $class, string $name ) : \modElement | null

Get a modElement instance taking advantage of the modX::$sourceCache.

Parameters
Name Type Description
$class string

The modElement derivative class to load.

$name string

An element name or raw tagName to identify the modElement instance.

Returns
Type Description
\modElement | null An instance of the specified modElement derivative class.
methodpublicisProcessingTag( ) : bool

Returns true if the parser is currently processing a tag

Returns
Type Description
bool
methodpublicisProcessingUncacheable( ) : bool

Returns true if the parser is currently processing an uncacheable tag

Returns
Type Description
bool
methodpublicisRemovingUnprocessed( ) : bool

Returns true if the parser is currently removing any unprocessed tags

Returns
Type Description
bool
methodpublicloadFromCache( string $tag ) : string

Loads output cached by complete tag signature from the elementCache.

Parameters
Name Type Description
$tag string

The tag signature representing the element instance.

Returns
Type Description
string The cached output from the element instance.
Details
Uses
\modX::$_elementCache  
methodpublicmergeTagOutput( array $tagMap, string $content ) : void

Merges processed tag output into provided content string.

Parameters
Name Type Description
$tagMap array

An array with full tags as keys and processed output as the values.

$content string

The content to merge the tag output with (passed by reference).

methodpublicparseProperties( string $propSource ) : array

Parses an element/tag property string or array definition.

Parameters
Name Type Description
$propSource string

A valid property string or array source to parse.

Returns
Type Description
array An associative array of property values parsed from the property string or array definition.
methodpublicparsePropertyString( string $string, boolean $valuesOnly = false ) : array

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

Parameters
Name Type Description
$string string

The property string to parse.

$valuesOnly boolean

Indicates only the property value should be returned.

Returns
Type Description
array The processed properties in array format
methodpublicprocessElementTags( string $parentTag, string $content, boolean $processUncacheable = false, boolean $removeUnprocessed = false, string $prefix = "[[", string $suffix = "]]", array $tokens = array (), integer $depth = 0 ) : int

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

Parameters
Name Type Description
$parentTag string

The tag representing the element processing this tag. Pass an empty string to allow parsing without this recursion check.

$content string

The content to process and act on (by reference).

$processUncacheable boolean

Determines if noncacheable tags are to be processed (default= false).

$removeUnprocessed boolean

Determines if unprocessed tags should be left in place in the content, or stripped out (default= false).

$prefix string

The characters that define the start of a tag (default= "[[").

$suffix string

The characters that define the end of a tag (default= "]]").

$tokens array

Indicates that the parser should only process tags with the tokens included in this array.

$depth integer

The maximum iterations to recursively process tags returned by prior passes, 0 by default.

Returns
Type Description
int The number of processed tags
methodpublicprocessTag( string $tag, boolean $processUncacheable = true ) : mixed

Processes a modElement tag and returns the result.

Parameters
Name Type Description
$tag string

A full tag string parsed from content.

$processUncacheable boolean
Returns
Type Description
mixed The output of the processed element represented by the specified tag.
methodpublicrealname( string $unfiltered ) : string

Gets the real name of an element containing filter modifiers.

Parameters
Name Type Description
$unfiltered string

The unfiltered name of a {@link modElement}.

Returns
Type Description
string The name minus any filter modifiers.

\modPlaceholderTag

Package: modx

Represents placeholder tags.

[[+placeholder_key]] Represents a placeholder with name placeholder_key.

Parent(s)
\modTag
Uses
\modX::getPlaceholder()  

Properties

Propertypublicboolean  $_cacheable= 'true'
inherited

Whether or not this tag is marked as cacheable

Inherited from: \modTag::$$_cacheable
Default valuetrueDetails
Type
boolean
Inherited_from
\modTag::$$_cacheable  
Propertypublicstring  $_content= 'null'
inherited

The content of the tag

Inherited from: \modTag::$$_content
Default valuenullDetails
Type
string
Inherited_from
\modTag::$$_content  
Propertypublicarray  $_fields= 'array( 'name' => '', 'properties' => '' )'
inherited

Fields on the tag

Inherited from: \modTag::$$_fields
Default valuearray( 'name' => '', 'properties' => '' )Details
Type
array
Inherited_from
\modTag::$$_fields  
Propertypublicarray  $_filters= 'array('input' => null, 'output' => null)'
inherited

Any output/input filters on this tag

Inherited from: \modTag::$$_filters
Default valuearray('input' => null, 'output' => null)Details
Type
array
Inherited_from
\modTag::$$_filters  
Propertypublicstring  $_output= ''''
inherited

The processed output of the tag

Inherited from: \modTag::$$_output
Default value''Details
Type
string
Inherited_from
\modTag::$$_output  
Propertypublicboolean  $_processed= 'false'
inherited

Whether or not the tag has been processed

Inherited from: \modTag::$$_processed
Default valuefalseDetails
Type
boolean
Inherited_from
\modTag::$$_processed  
Propertypublicarray  $_properties= 'array()'
inherited

The arranged properties array for this tag

Inherited from: \modTag::$$_properties
Default valuearray()Details
Type
array
Inherited_from
\modTag::$$_properties  
Propertypublicstring  $_propertyString= ''''
inherited

Just the isolated properties part of the tag string

Inherited from: \modTag::$$_propertyString
Default value''Details
Type
string
Inherited_from
\modTag::$$_propertyString  
Propertypublicbool  $_result= 'true'
inherited

The result of processing the tag

Inherited from: \modTag::$$_result
Default valuetrueDetails
Type
bool
Inherited_from
\modTag::$$_result  
Propertypublicstring  $_tag= ''''
inherited

The tag string

Inherited from: \modTag::$$_tag
Default value''Details
Type
string
Inherited_from
\modTag::$$_tag  
Propertypublicstring  $_token= ''''
inherited

The tag initial token ($,%,*,etc)

Inherited from: \modTag::$$_token
Default value''Details
Type
string
Inherited_from
\modTag::$$_token  
Propertypublic\modX  $modx= 'null'
inherited

A reference to the modX instance

Inherited from: \modTag::$$modx
Default valuenullDetails
Type
\modX
Inherited_from
\modTag::$$modx  
Propertypublicstring  $name= ''
inherited

The name of the tag

Inherited from: \modTag::$$name
Details
Type
string
Inherited_from
\modTag::$$name  
Propertypublicarray  $properties= ''
inherited

The properties on the tag

Inherited from: \modTag::$$properties
Details
Type
array
Inherited_from
\modTag::$$properties  

Methods

methodpublic__construct( \modX $modx ) : void

Overrides modTag::__construct to set the Placeholder Tag token Set a reference to the modX object, load the name and properties, and instantiate the tag class instance.

Parameters
Name Type Description
$modx \modX

A reference to the modX object

methodpubliccache( ) : void
inherited

Cache the element into the elementCache by tag signature.

Inherited from: \modTag::cache()
Details
See
\modElement::cache()  
methodpublicfilterInput( ) : void
inherited

Apply an input filter to a tag.

Inherited from: \modTag::filterInput()

This is called by default in {@link modTag::process()} after the tag properties have been parsed.

Details
See
\modElement::filterInput()  
methodpublicfilterOutput( ) : void
inherited

Apply an output filter to a tag.

Inherited from: \modTag::filterOutput()

Call this method in your {modTag::process()} implementation when it is appropriate, typically once all processing has been completed, but before any caching takes place.

Details
See
\modElement::filterOutput()  
methodpublicget( string $k ) : mixed
inherited

Generic getter method for modTag attributes.

Inherited from: \modTag::get()
Parameters
Name Type Description
$k string

The field key.

Returns
Type Description
mixed The value of the field or null if it is not set.
Details
See
\xPDOObject::get()  
methodpublicgetContent( array $options = array() ) : string

Get the raw source content of the field.

Parameters
Name Type Description
$options array

An array of options implementations can use to accept language, revision identifiers, or other information to alter the behavior of the method.

Returns
Type Description
string The raw source content for the element.
methodpublicgetInputFilter( ) : \modInputFilter | null
inherited

Get an input filter instance configured for this Element.

Inherited from: \modTag::getInputFilter()
Returns
Type Description
\modInputFilter | null An input filter instance (or null if one cannot be loaded).
methodpublicgetOutputFilter( ) : \modOutputFilter | null
inherited

Get an output filter instance configured for this Element.

Inherited from: \modTag::getOutputFilter()
Returns
Type Description
\modOutputFilter | null An output filter instance (or null if one cannot be loaded).
methodpublicgetProperties( array | string $properties = null ) : array
inherited

Get the properties for this element instance for processing.

Inherited from: \modTag::getProperties()
Parameters
Name Type Description
$properties array | string

An array or string of properties to apply.

Returns
Type Description
array A simple array of properties ready to use for processing.
methodpublicgetPropertySet( string | null $setName = null ) : array | null
inherited

Gets a named property set to use with this modTag instance.

Inherited from: \modTag::getPropertySet()

This function will attempt to extract a setName from the tag name using the @ symbol to delimit the name of the property set. If a setName parameter is provided, the function will override any property set specified in the name by merging both property sets.

Here is an example of an tag using the @ modifier to specify a property set name: [[~TagName@PropertySetName:FilterCommand=FilterModifier? &PropertyKey1=PropertyValue1 &PropertyKey2=PropertyValue2 ]]

Parameters
Name Type Description
$setName string | null

An explicit property set name to search for.

Returns
Type Description
array | null An array of properties or null if no set is found.
methodpublicgetTag( ) : string
inherited

Gets a tag representation of the modTag instance.

Inherited from: \modTag::getTag()
Returns
Type Description
string
methodpublicgetToken( ) : string
inherited

Returns the current token for the tag

Inherited from: \modTag::getToken()
Returns
Type Description
string The token for the tag
methodpublicisCacheable( ) : boolean

modPlaceholderTag instances cannot be cacheable.

Returns
Type Description
boolean Always returns false.
methodpublicprocess( array | string $properties = null, string $content = null ) : mixed

Processes the modPlaceholderTag, recursively processing nested tags.

Tags in the properties of the tag itself, or the content returned by the tag element are processed. Non-cacheable nested tags are only processed if this tag element is also non-cacheable.

Parameters
Name Type Description
$properties array | string

An array of properties or a formatted property string.

$content string

Optional content to use for the element processing.

Returns
Type Description
mixed The result of processing the tag.
methodpublicset( string $k, mixed $v ) : void
inherited

Generic setter method for modTag attributes.

Inherited from: \modTag::set()
Parameters
Name Type Description
$k string

The field key.

$v mixed

The value to assign to the field.

Details
See
\xPDOObject::set()  
methodpublicsetCacheable( boolean $cacheable = true ) : void

modPlaceholderTag instances cannot be cacheable.

Parameters
Name Type Description
$cacheable boolean

Indicates the value to set for cacheability of this element.

methodpublicsetContent( string $content, array $options = array() ) : boolean
inherited

Set the raw source content for the tag element.

Inherited from: \modTag::setContent()
Parameters
Name Type Description
$content string

The content to set

$options array

Ignored.

Returns
Type Description
boolean
methodpublicsetProperties( array | string $properties, boolean $merge = false ) : boolean
inherited

Set default properties for this element instance.

Inherited from: \modTag::setProperties()
Parameters
Name Type Description
$properties array | string

A property array or property string.

$merge boolean

Indicates if properties should be merged with existing ones.

Returns
Type Description
boolean true if the properties are set.
methodpublicsetTag( string $tag ) : void
inherited

Setter method for the tag class var.

Inherited from: \modTag::setTag()
Parameters
Name Type Description
$tag string

The tag to use for this element.

methodpublicsetToken( string $token ) : void
inherited

Setter method for the token class var.

Inherited from: \modTag::setToken()
Parameters
Name Type Description
$token string

The token to use for this element tag.

\modTag

Package: modx

Abstract class representing a pseudo-element that can be parsed.

Children
\modFieldTag
\modPlaceholderTag
\modLinkTag
\modLexiconTag
Abstract
You must implement the process() method on derivatives to implement a parseable element tag. All element tags are identified by a unique single character token at the beginning of the tag string.  

Properties

Propertypublicboolean  $_cacheable= 'true'

Whether or not this tag is marked as cacheable

Default valuetrueDetails
Type
boolean
Propertypublicstring  $_content= 'null'

The content of the tag

Default valuenullDetails
Type
string
Propertypublicarray  $_fields= 'array( 'name' => '', 'properties' => '' )'

Fields on the tag

Default valuearray( 'name' => '', 'properties' => '' )Details
Type
array
Propertypublicarray  $_filters= 'array('input' => null, 'output' => null)'

Any output/input filters on this tag

Default valuearray('input' => null, 'output' => null)Details
Type
array
Propertypublicstring  $_output= ''''

The processed output of the tag

Default value''Details
Type
string
Propertypublicboolean  $_processed= 'false'

Whether or not the tag has been processed

Default valuefalseDetails
Type
boolean
Propertypublicarray  $_properties= 'array()'

The arranged properties array for this tag

Default valuearray()Details
Type
array
Propertypublicstring  $_propertyString= ''''

Just the isolated properties part of the tag string

Default value''Details
Type
string
Propertypublicbool  $_result= 'true'

The result of processing the tag

Default valuetrueDetails
Type
bool
Propertypublicstring  $_tag= ''''

The tag string

Default value''Details
Type
string
Propertypublicstring  $_token= ''''

The tag initial token ($,%,*,etc)

Default value''Details
Type
string
Propertypublic\modX  $modx= 'null'

A reference to the modX instance

Default valuenullDetails
Type
\modX
Propertypublicstring  $name= ''

The name of the tag

Details
Type
string
Propertypublicarray  $properties= ''

The properties on the tag

Details
Type
array

Methods

methodpublic__construct( \modX $modx ) : void

Set a reference to the modX object, load the name and properties, and instantiate the tag class instance.

Parameters
Name Type Description
$modx \modX

A reference to the modX object

methodpubliccache( ) : void

Cache the element into the elementCache by tag signature.

Details
See
\modElement::cache()  
methodpublicfilterInput( ) : void

Apply an input filter to a tag.

This is called by default in {@link modTag::process()} after the tag properties have been parsed.

Details
See
\modElement::filterInput()  
methodpublicfilterOutput( ) : void

Apply an output filter to a tag.

Call this method in your {modTag::process()} implementation when it is appropriate, typically once all processing has been completed, but before any caching takes place.

Details
See
\modElement::filterOutput()  
methodpublicget( string $k ) : mixed

Generic getter method for modTag attributes.

Parameters
Name Type Description
$k string

The field key.

Returns
Type Description
mixed The value of the field or null if it is not set.
Details
See
\xPDOObject::get()  
methodpublicgetContent( array $options = array() ) : string

Get the raw source content of the tag element.

Parameters
Name Type Description
$options array

An array of options implementations can use to accept language, revision identifiers, or other information to alter the behavior of the method.

Returns
Type Description
string The raw source content for the element.
methodpublicgetInputFilter( ) : \modInputFilter | null

Get an input filter instance configured for this Element.

Returns
Type Description
\modInputFilter | null An input filter instance (or null if one cannot be loaded).
methodpublicgetOutputFilter( ) : \modOutputFilter | null

Get an output filter instance configured for this Element.

Returns
Type Description
\modOutputFilter | null An output filter instance (or null if one cannot be loaded).
methodpublicgetProperties( array | string $properties = null ) : array

Get the properties for this element instance for processing.

Parameters
Name Type Description
$properties array | string

An array or string of properties to apply.

Returns
Type Description
array A simple array of properties ready to use for processing.
methodpublicgetPropertySet( string | null $setName = null ) : array | null

Gets a named property set to use with this modTag instance.

This function will attempt to extract a setName from the tag name using the @ symbol to delimit the name of the property set. If a setName parameter is provided, the function will override any property set specified in the name by merging both property sets.

Here is an example of an tag using the @ modifier to specify a property set name: [[~TagName@PropertySetName:FilterCommand=FilterModifier? &PropertyKey1=PropertyValue1 &PropertyKey2=PropertyValue2 ]]

Parameters
Name Type Description
$setName string | null

An explicit property set name to search for.

Returns
Type Description
array | null An array of properties or null if no set is found.
methodpublicgetTag( ) : string

Gets a tag representation of the modTag instance.

Returns
Type Description
string
methodpublicgetToken( ) : string

Returns the current token for the tag

Returns
Type Description
string The token for the tag
methodpublicisCacheable( ) : boolean

Indicates if the element is cacheable.

Returns
Type Description
boolean True if the element can be stored to or retrieved from the element cache.
methodpublicprocess( array | string $properties = null, string $content = null ) : mixed

Process the tag and return the result.

Parameters
Name Type Description
$properties array | string

An array of properties or a formatted property string.

$content string

Optional content to use for the element processing.

Returns
Type Description
mixed The result of processing the tag.
Details
See
\modElement::process()  
methodpublicset( string $k, mixed $v ) : void

Generic setter method for modTag attributes.

Parameters
Name Type Description
$k string

The field key.

$v mixed

The value to assign to the field.

Details
See
\xPDOObject::set()  
methodpublicsetCacheable( boolean $cacheable = true ) : void

Sets the runtime cacheability of the element.

Parameters
Name Type Description
$cacheable boolean

Indicates the value to set for cacheability of this element.

methodpublicsetContent( string $content, array $options = array() ) : boolean

Set the raw source content for the tag element.

Parameters
Name Type Description
$content string

The content to set

$options array

Ignored.

Returns
Type Description
boolean
methodpublicsetProperties( array | string $properties, boolean $merge = false ) : boolean

Set default properties for this element instance.

Parameters
Name Type Description
$properties array | string

A property array or property string.

$merge boolean

Indicates if properties should be merged with existing ones.

Returns
Type Description
boolean true if the properties are set.
methodpublicsetTag( string $tag ) : void

Setter method for the tag class var.

Parameters
Name Type Description
$tag string

The tag to use for this element.

methodpublicsetToken( string $token ) : void

Setter method for the token class var.

Parameters
Name Type Description
$token string

The token to use for this element tag.

Documentation was generated by DocBlox 0.18.1.