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

Class: HTML_Template_Flexy_Assign

Source Location: /HTML_Template_Flexy-1.3.13/HTML/Template/Flexy/Assign.php

Class Overview




Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 26]


[ Top ]


Class Variables

$references = array()

[line 41]

The references stored in the Assigner
  • Access: public

Type:   array


[ Top ]

$variables = array()

[line 34]

The variables stored in the Assigner
  • Access: public

Type:   array


[ Top ]



Method Detail

assign   [line 92]

bool|PEAR_Error assign( $args, string|array|object $args[0], mixed $args[1])

Assigns a token-name and value to $this->_token_vars for use in a template.

There are three valid ways to assign values to a template.

Form 1: $args[0] is a string and $args[1] is mixed. This means $args[0] is a token name and $args[1] is the token value (which allows objects, arrays, strings, numbers, or anything else). $args[1] can be null, which means the corresponding token value in the template will also be null.

Form 2: $args[0] is an array and $args[1] is not set. Assign a series of tokens where the key is the token name, and the value is token value.

Form 3: $args[0] is an object and $args[1] is not set. Assigns copies of all object variables (properties) to tokens; the token name and value is a copy of each object property and value.

  • Return: Boolean true if all assignments were committed, or a PEAR_Error object if there was an error.
  • Author: Paul M. Jones <pmjones@ciaweb.net>
  • See: assignObject()
  • See: assignRef()
  • Throws: SAVANT_ERROR_ASSIGN Unknown reason for error, probably because you passed $args[1] when $args[0] is an array or object.
  • Access: public

Parameters:

string|array|object    $args[0]   —  This param can be a string, an array, or an object. If $args[0] is a string, it is the name of a variable in the template. If $args[0] is an array, it must be an associative array of key-value pairs where the key is a variable name in the template and the value is the value for that variable in the template. If $args[0] is an object, copies of its properties will be assigned to the template.
mixed   $args[1]   —  If $args[0] is an array or object, $args[1] should not be set. Otherwise, a copy of $args[1] is assigned to a template variable named after $args[0].
   $args   — 

[ Top ]

assignRef   [line 179]

bool|PEAR_Error assignRef( string $name, mixed &$ref)

Assign a token by reference. This allows you change variable values within the template and have those changes reflected back at the calling logic script. Works as with form 2 of assign().
  • Return: Boolean true on success, or a PEAR_Error on failure.
  • Author: Paul M. Jones <pmjones@ciaweb.net>
  • See: assignObject()
  • See: assign()
  • Throws: SAVANT_ERROR_ASSIGN_REF Unknown reason for error.
  • Access: public

Parameters:

string   $name   —  The template token-name for the reference.
mixed   &$ref   —  The variable passed by-reference.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:59:55 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.