Helper for declaring default values of template variables

package Default
inherited_from \Zend\View\Helper\AbstractHelper

 Methods

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

__invoke() : void

Primarily for use when using Zend\View\Variables::setStrictVars(), 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() ) );

Get the view object

getView() : null | \Zend\View\Renderer\RendererInterface
Inherited
inherited_from \Zend\View\Helper\HelperInterface::getView()

Returns

null\Zend\View\Renderer\RendererInterface

Set the View object

setView(\Zend\View\Renderer\RendererInterface $view) : \Zend\View\Helper\AbstractHelper
Inherited
inherited_from \Zend\View\Helper\HelperInterface::setView()

Parameters

$view

\Zend\View\Renderer\RendererInterface

Returns

\Zend\View\Helper\AbstractHelper

Set a view variable

declareVar(string $key, string $value = '') : void

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

Parameters

$key

string

$value

string

Defaults to an empty string

 Properties

 

The view object that created this helper object.

$view : \Zend\View\View

Default

inherited_from \Zend\View\Helper\AbstractHelper::view
 

View object instance

$view : \Zend\View\Renderer\RendererInterface

Default

null