Public Member Functions | Data Fields | Protected Member Functions

Zend_View_Helper_DeclareVars Class Reference

Inheritance diagram for Zend_View_Helper_DeclareVars:
Zend_View_Helper_Abstract Zend_View_Helper_Interface

Public Member Functions

 declareVars ()

Data Fields

 $view

Protected Member Functions

 _declareVar ($key, $value= '')

Detailed Description

Definition at line 34 of file DeclareVars.php.


Member Function Documentation

_declareVar ( key,
value = '' 
) [protected]

Set a view variable

Checks to see if a $key is set in the view object; if not, sets it to $value.

Parameters:
string$key
string$valueDefaults to an empty string
Returns:
void

Definition at line 89 of file DeclareVars.php.

declareVars (  )

Declare template vars to set default values and avoid notices when using strictVars

Primarily for use when using Zend_View strictVars(), this helper can be used to declare template variables that may or may not already be set in the view object, as well as to set default values. Arrays passed as arguments to the method will be used to set default values; otherwise, if the variable does not exist, it is set to an empty string.

Usage: $this->declareVars( 'varName1', 'varName2', array('varName3' => 'defaultValue', 'varName4' => array() ) );

Parameters:
string|arrayvariable number of arguments, all string names of variables to test
Returns:
void

Definition at line 66 of file DeclareVars.php.


The documentation for this class was generated from the following file: