Class modTemplateVar

Description

Represents a template variable element.

  • todo: Refactor this to allow user-defined and configured input and output widgets.

Located in /model/modx/modtemplatevar.class.php (line 9)

xPDOObject
   |
   --modAccessibleObject
      |
      --modAccessibleSimpleObject
         |
         --modElement
            |
            --modTemplateVar
Variable Summary
 array $bindings
 integer $resourceId
Method Summary
 modTemplateVar __construct ( &$xpdo)
 string decodeParamValue (string $s)
 void findPolicy ([ $context = ''])
 array getBindingDataFromValue (mixed $value)
 void getContent ([ $options = array()])
 array getDisplayParams ()
 string getRender (array $params, mixed $value,  $paths, string $method, [integer $resourceId = 0], [string $type = 'text'])
 array getRenderDirectories (string $event, string $subdir)
 mixed getValue ([integer $resourceId = 0])
 array parseBinding (string $binding_string)
 string|array parseInput (mixed $src, [string $delim = "||"], [string $type = "string"])
 mixed parseInputOptions (mixed $v)
 void process ([ $properties = null], [ $content = null])
 string processBindings ([string $value = ''], [integer $resourceId = 0], [boolean $preProcess = true])
 string processFileBinding (string $file)
 string processInheritBinding ([string $default = ''], [int $resourceId = null])
 void remove ([ $ancestors = array ()])
 mixed renderInput ([integer $resourceId = 0], [string $style = ''])
 mixed renderOutput ([integer $resourceId = 0])
 void save ([ $cacheFlag = null])
 void setContent ( $content, [ $options = array()])
 void setValue ([integer $resourceId = 0], [mixed $value = null])
Variables
Methods
Constructor __construct (line 35)

Creates a modTemplateVar instance, and sets the token of the class to *

modTemplateVar __construct ( &$xpdo)
  • &$xpdo

Redefinition of:
xPDOObject::__construct()
Constructor
decodeParamValue (line 470)

Decodes special function-based chars from a parameter value.

  • return: The decoded string.
  • access: public
string decodeParamValue (string $s)
  • string $s: The string to decode.
findPolicy (line 768)

Loads the access control policies applicable to this template variable.

  • access: public
void findPolicy ([ $context = ''])
  • $context

Redefinition of:
modElement::findPolicy()
Loads the access control policies applicable to this element.
getBindingDataFromValue (line 560)

Parses the binding data from a value

  • return: An array of cmd and param for the binding
  • access: public
array getBindingDataFromValue (mixed $value)
  • mixed $value: The value to parse
getContent (line 141)

Get the source content of this template variable.

  • access: public
void getContent ([ $options = array()])
  • array $options

Redefinition of:
modElement::getContent()
Gets the raw, unprocessed source content for this element.
getDisplayParams (line 481)

Returns an array of display params for this TV

  • return: The processed settings
  • access: public
array getDisplayParams ()
getRender (line 384)

Gets the correct render given paths and type of render

  • access: public
string getRender (array $params, mixed $value,  $paths, string $method, [integer $resourceId = 0], [string $type = 'text'])
  • array $params: The parameters to pass to the render
  • mixed $value: The value of the TV
  • array $paths: An array of paths to search
  • string $method: The type of Render (input/output/properties)
  • integer $resourceId: The ID of the current Resource
  • string $type: The type of render to display
getRenderDirectories (line 429)

Finds the correct directories for renders

  • return: The found render directories
  • access: public
array getRenderDirectories (string $event, string $subdir)
  • string $event: The plugin event to fire
  • string $subdir: The subdir to search
getValue (line 169)

Get the value of a template variable for a resource.

  • return: The raw value of the template variable in context of the specified resource or the default_text for the tv.
  • access: public
mixed getValue ([integer $resourceId = 0])
  • integer $resourceId: The id of the resource; 0 defaults to the default_text field for the tv.
parseBinding (line 692)

Parses bindings to an appropriate format.

  • return: The parsed binding, now in array format.
  • access: public
array parseBinding (string $binding_string)
  • string $binding_string: The binding to parse.
parseInput (line 507)

Returns an string if a delimiter is present. Returns array if is a recordset is present.

  • return: If delimiter present, returns string, otherwise array.
  • access: public
string|array parseInput (mixed $src, [string $delim = "||"], [string $type = "string"])
  • mixed $src: Source object, either a recordset, PDOStatement, array or string.
  • string $delim: Delimiter for string parsing.
  • string $type: Type to return, either 'string' or 'array'.
parseInputOptions (line 542)

Parses input options sent through postback.

  • return: The parsed options.
  • access: public
mixed parseInputOptions (mixed $v)
  • mixed $v: The options to parse, either a recordset, PDOStatement, array or string.
process (line 103)

Process the template variable and return the output.

  • access: public
void process ([ $properties = null], [ $content = null])
  • $properties
  • $content

Redefinition of:
modElement::process()
Process the element source content to produce a result.
processBindings (line 580)

Process bindings assigned to a template variable.

  • return: The processed value.
  • access: public
string processBindings ([string $value = ''], [integer $resourceId = 0], [boolean $preProcess = true])
  • string $value: The value specified from the binding.
  • integer $resourceId: The resource in which the TV is assigned.
  • boolean $preProcess: Whether or not to process certain bindings.
processFileBinding (line 746)

Special parsing for file bindings.

  • return: The file buffer from the read file.
  • access: public
string processFileBinding (string $file)
  • string $file: The absolute location of the file in the binding.
processInheritBinding (line 713)

Parse inherit binding

  • return: The inherited value
  • access: public
string processInheritBinding ([string $default = ''], [int $resourceId = null])
  • string $default: The value to default if there is no inherited value
  • int $resourceId: The current Resource, if any
remove (line 76)

Overrides modElement::remove to add custom error logging and fire modX-specific events.

  • access: public
void remove ([ $ancestors = array ()])
  • array $ancestors

Redefinition of:
modElement::remove()
Overrides xPDOObject::remove to remove all Property Sets that are related to this object.
renderInput (line 269)

Renders input forms for the template variable.

  • return: The rendered input for the template variable.
  • access: public
mixed renderInput ([integer $resourceId = 0], [string $style = ''])
  • integer $resourceId: The id of the resource; 0 defaults to the current resource.
  • string $style: Extra style parameters. (deprecated)
renderOutput (line 238)

Returns the processed output of a template variable.

  • return: The processed output of the template variable.
  • access: public
mixed renderOutput ([integer $resourceId = 0])
  • integer $resourceId: The id of the resource; 0 defaults to the current resource.
save (line 46)

Overrides modElement::save to add custom error logging and fire modX-specific events.

  • access: public
void save ([ $cacheFlag = null])
  • $cacheFlag

Redefinition of:
modAccessibleObject::save()
Custom save that respects access policies.
setContent (line 157)

Set the source content of this template variable.

  • access: public
void setContent ( $content, [ $options = array()])
  • $content
  • array $options

Redefinition of:
modElement::setContent()
Set the raw source content for this element.
setValue (line 203)

Set the value of a template variable for a resource.

  • access: public
void setValue ([integer $resourceId = 0], [mixed $value = null])
  • integer $resourceId: The id of the resource; 0 defaults to the current resource.
  • mixed $value: The value to give the template variable for the specified document.

Inherited Methods

Inherited From modElement

 modElement::addPropertySet()
 modElement::cache()
 modElement::filterInput()
 modElement::filterOutput()
 modElement::findPolicy()
 modElement::get()
 modElement::getContent()
 modElement::getInputFilter()
 modElement::getOutputFilter()
 modElement::getProperties()
 modElement::getPropertySet()
 modElement::getTag()
 modElement::getToken()
 modElement::isCacheable()
 modElement::process()
 modElement::remove()
 modElement::removePropertySet()
 modElement::set()
 modElement::setCacheable()
 modElement::setContent()
 modElement::setProperties()
 modElement::setTag()
 modElement::setToken()
 modElement::toPlaceholders()

Inherited From modAccessibleObject

 modAccessibleObject::checkPolicy()
 modAccessibleObject::findPolicy()
 modAccessibleObject::getPolicies()
 modAccessibleObject::load()
 modAccessibleObject::loadCollection()
 modAccessibleObject::remove()
 modAccessibleObject::save()
 modAccessibleObject::setPolicies()
 modAccessibleObject::_loadCollectionInstance()
 modAccessibleObject::_loadInstance()

Inherited From xPDOObject

 xPDOObject::__construct()
 xPDOObject::addMany()
 xPDOObject::addOne()
 xPDOObject::addValidationRule()
 xPDOObject::encode()
 xPDOObject::fromArray()
 xPDOObject::fromJSON()
 xPDOObject::get()
 xPDOObject::getFieldName()
 xPDOObject::getFKClass()
 xPDOObject::getFKDefinition()
 xPDOObject::getMany()
 xPDOObject::getOne()
 xPDOObject::getOption()
 xPDOObject::getPK()
 xPDOObject::getPKType()
 xPDOObject::getPrimaryKey()
 xPDOObject::getSelectColumns()
 xPDOObject::getValidator()
 xPDOObject::isDirty()
 xPDOObject::isLazy()
 xPDOObject::isNew()
 xPDOObject::isValidated()
 xPDOObject::load()
 xPDOObject::loadCollection()
 xPDOObject::loadCollectionGraph()
 xPDOObject::remove()
 xPDOObject::removeValidationRules()
 xPDOObject::save()
 xPDOObject::set()
 xPDOObject::setDirty()
 xPDOObject::setOption()
 xPDOObject::toArray()
 xPDOObject::toJSON()
 xPDOObject::validate()
 xPDOObject::_getAliases()
 xPDOObject::_getDataType()
 xPDOObject::_getPHPType()
 xPDOObject::_getRelatedObjectsByFK()
 xPDOObject::_initFields()
 xPDOObject::_loadCollectionInstance()
 xPDOObject::_loadFieldData()
 xPDOObject::_loadInstance()
 xPDOObject::_loadRows()
 xPDOObject::_loadValidation()
 xPDOObject::_saveRelatedObject()
 xPDOObject::_saveRelatedObjects()
 xPDOObject::_setRaw()

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