API Documentation

View/Helper/DeclareVars.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_View  
subpackage
Helper  
version
$Id: DeclareVars.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_View_Helper_DeclareVars

Helper for declaring default values of template variables

Extends from
\Zend_View_Helper_Abstract
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_View  
subpackage
Helper  

Properties

Propertypublic\Zend_View  $view= ''

The view object that created this helper object.

Details
Type
\Zend_View

Methods

methodprotected_declareVar( string $key, string $value ) : void

Set a view variable

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

Parameters
Name Type Description
$key string
$value string Defaults to an empty string
methodpublicdeclareVars( ) : void

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

Primarily for use when using {@link Zend_View_Abstract::strictVars() 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()
    )
);
methodpublicdirect( ) : void

Strategy pattern: currently unutilized

Inherited from: \Zend_View_Helper_Abstract::direct()
methodpublicsetView( \Zend_View_Interface $view ) : \Zend_View_Helper_Abstract

Set the View object

Inherited from: \Zend_View_Helper_Abstract::setView()
Parameters
Name Type Description
$view \Zend_View_Interface
Returns
Type Description
\Zend_View_Helper_Abstract
Documentation was generated by DocBlox 0.13.3.