Helper for escaping values

package Default
inherited_from \Zend\View\Helper\AbstractHelper

 Methods

Invoke this helper: escape a value

__invoke(mixed $value, integer $recurse = self::RECURSE_NONE) : mixed

Parameters

$value

mixed

$recurse

integer

Expects one of the recursion constants; used to decide whether or not to recurse the given value when escaping

Exceptions

\Zend\View\Exception\InvalidArgumentException

Returns

mixedGiven a scalar, a scalar value is returned. Given an object, with the $recurse flag not allowing object recursion, returns a string. Otherwise, returns an array.

Get the encoding to use for escape operations

getEncoding() : string

Returns

string

Get instance of Escaper

getEscaper() : null | \Zend\Escaper\Escaper

Returns

null\Zend\Escaper\Escaper

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 encoding to use for escape operations

setEncoding(string $encoding) : \Zend\View\Helper\Escaper\AbstractHelper

Parameters

$encoding

string

Exceptions

\Zend\View\Exception\InvalidArgumentException

Returns

\Zend\View\Helper\Escaper\AbstractHelper

Set instance of Escaper

setEscaper(\Zend\Escaper\Escaper $escaper) : \Zend\View\Helper\Escaper\AbstractHelper

Parameters

$escaper

\Zend\Escaper\Escaper

Returns

\Zend\View\Helper\Escaper\AbstractHelper

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

Escape a value for current escaping strategy

escape(string $value) : string

Parameters

$value

string

Returns

string

 Properties

 

Encoding

$encoding : string

Default

'UTF-8'
 

$escaper

$escaper : \Zend\Escaper\Escaper

Default

null
 

View object instance

$view : \Zend\View\Renderer\RendererInterface

Default

null

 Constants

 

RECURSE_ARRAY

RECURSE_ARRAY = 1 
 

RECURSE_NONE

RECURSE_NONE = 0 
const Recursion constants
 

RECURSE_OBJECT

RECURSE_OBJECT = 2