Concrete class for handling view scripts.

category Zend
package Zend_View
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license http://framework.zend.com/license/new-bsd New BSD License Convenience methods for build in helpers (@see __call):
inherited_from \Zend_View_Abstract

 Methods

Accesses a helper object from within a script.

__call(string $name, array $args) : string
Inherited

If the helper class has a 'view' property, sets it with the current view object.

Parameters

$name

string

The helper name.

$args

array

The parameters for the helper.

Returns

stringThe result of the helper output.

Constructor

__construct(array $config = array()) : void

Register Zend_View_Stream stream wrapper if short tags are disabled.

inherited_from \Zend_View_Abstract::__construct()

Parameters

$config

array

Constructor.

__construct(array $config = array()
Inherited

Parameters

$config

array

Configuration key-value pairs.

Prevent E_NOTICE for nonexistent values

__get(string $key) : null
Inherited

If \strictVars() is on, raises a notice.

Parameters

$key

string

Returns

null

Allows testing with empty() and isset() to work inside templates.

__isset(string $key) : boolean
Inherited
inherited_from \Zend_View_Interface::__isset()

Parameters

$key

string

Returns

boolean

Directly assigns a variable to the view script.

__set(string $key, mixed $val) : void
Inherited

Checks first to ensure that the caller is not attempting to set a protected or private member (by checking for a prefixed underscore); if not, the public member is set; otherwise, an exception is raised.

inherited_from \Zend_View_Interface::__set()

Parameters

$key

string

The variable name.

$val

mixed

The variable value.

Exceptions

\Zend_View_Exception if an attempt to set a private or protected member is detected

Allows unset() on object properties to work

__unset(string $key) : void
Inherited
inherited_from \Zend_View_Interface::__unset()

Parameters

$key

string

Given a base path, add script, helper, and filter paths relative to it

addBasePath(string $path, string $classPrefix = 'Zend_View') : \Zend_View_Abstract
Inherited

Assumes a directory structure of: basePath/ scripts/ helpers/ filters/

inherited_from \Zend_View_Interface::addBasePath()

Parameters

$path

string

$classPrefix

Returns

\Zend_View_Abstract

Add one or more filters to the stack in FIFO order.

addFilter($name) : \Zend_View_Abstract
Inherited

Parameters

$name

Returns

\Zend_View_Abstract

Adds to the stack of filter paths in LIFO order.

addFilterPath($path, string $classPrefix = 'Zend_View_Filter_') : \Zend_View_Abstract
Inherited

Parameters

$path

$classPrefix

string

Class prefix to use with classes in this directory; defaults to Zend_View_Filter

Returns

\Zend_View_Abstract

Adds to the stack of helper paths in LIFO order.

addHelperPath($path, string $classPrefix = 'Zend_View_Helper_') : \Zend_View_Abstract
Inherited

Parameters

$path

$classPrefix

string

Class prefix to use with classes in this directory; defaults to Zend_View_Helper

Returns

\Zend_View_Abstract

Adds to the stack of view script paths in LIFO order.

addScriptPath($path) : \Zend_View_Abstract
Inherited

Parameters

$path

Returns

\Zend_View_Abstract

Assigns variables to the view script via differing strategies.

assign(string|array $spec, mixed $value = null) : \Zend_View_Abstract
Inherited

Zend_View::assign('name', $value) assigns a variable called 'name' with the corresponding $value.

Zend_View::assign($array) assigns the array keys as variable names (with the corresponding array values).

see
inherited_from \Zend_View_Interface::assign()

Parameters

$spec

$value

Exceptions

\Zend_View_Exception if $spec is neither a string nor an array, or if an attempt to set a private or protected member is detected

Returns

\Zend_View_AbstractFluent interface

baseUrl()

baseUrl() : 
magic
method

Returns

Clear all assigned variables

clearVars() : void
Inherited

Clears all variables assigned to Zend_View either via \assign() or property overloading (__set()).

inherited_from \Zend_View_Interface::clearVars()

currency()

currency() : 
magic
method

Returns

, $name = Zend_View_Helper_Cycle::DEFAULT_NAME)

cycle() : 
magic
method , $name = Zend_View_Helper_Cycle::DEFAULT_NAME)

Returns

doctype()

doctype() : 
magic
method

Returns

Escapes a value for output in a view script.

escape(mixed $var) : mixed
Inherited

If escaping mechanism is one of htmlspecialchars or htmlentities, uses \$_encoding setting.

Parameters

$var

mixed

The output to escape.

Returns

mixedThe escaped value.

fieldset()

fieldset() : 
magic
method

Returns

form()

form() : 
magic
method

Returns

formButton()

formButton() : 
magic
method

Returns

formCheckbox()

formCheckbox() : 
magic
method

Returns

formErrors()

formErrors() : 
magic
method

Returns

formFile()

formFile() : 
magic
method

Returns

formHidden()

formHidden() : 
magic
method

Returns

formImage()

formImage() : 
magic
method

Returns

formLabel()

formLabel() : 
magic
method

Returns

formMultiCheckbox()

formMultiCheckbox() : 
magic
method

Returns

formNote()

formNote() : 
magic
method

Returns

formPassword()

formPassword() : 
magic
method

Returns

formRadio()

formRadio() : 
magic
method

Returns

formReset()

formReset() : 
magic
method

Returns

formSelect()

formSelect() : 
magic
method

Returns

formSubmit()

formSubmit() : 
magic
method

Returns

formText()

formText() : 
magic
method

Returns

formTextarea()

formTextarea() : 
magic
method

Returns

Return associative array of path types => paths

getAllPaths() : array
Inherited

Returns

array

Return current escape encoding

getEncoding() : string
Inherited

Returns

string

Return the template engine object

getEngine() : \Zend_View_Abstract
Inherited

Returns the object instance, as it is its own template engine

inherited_from \Zend_View_Interface::getEngine()

Returns

\Zend_View_Abstract

Get a filter object by name

getFilter(string $name) : object
Inherited

Parameters

$name

string

Returns

object

Get full path to a filter class file specified by $name

getFilterPath(string $name) : string | false
Inherited

Parameters

$name

string

Returns

stringfalseFalse on failure, path on success

Returns an array of all currently set filter paths

getFilterPaths() : array
Inherited

Returns

array

Return array of all currently active filters

getFilters() : array
Inherited

Only returns those that have already been instantiated.

Returns

array

Get a helper by name

getHelper(string $name) : object
Inherited

Parameters

$name

string

Returns

object

Get full path to a helper class file specified by $name

getHelperPath(string $name) : string | false
Inherited

Parameters

$name

string

Returns

stringfalseFalse on failure, path on success

Returns an array of all currently set helper paths

getHelperPaths() : array
Inherited

Returns

array

Get array of all active helpers

getHelpers() : array
Inherited

Only returns those that have already been instantiated.

Returns

array

Retrieve plugin loader for a specific plugin type

getPluginLoader(string $type) : \Zend_Loader_PluginLoader
Inherited

Parameters

$type

string

Returns

\Zend_Loader_PluginLoader

Return full path to a view script specified by $name

getScriptPath(string $name) : false | string
Inherited

Parameters

$name

string

Exceptions

\Zend_View_Exception if no script directory set

Returns

falsestringFalse if script not found

Returns an array of all currently set script paths

getScriptPaths() : array
Inherited
inherited_from \Zend_View_Interface::getScriptPaths()

Returns

array

Return list of all assigned variables

getVars() : array
Inherited

Returns all public properties of the object. Reflection is not used here as testing reflection properties for visibility is buggy.

Returns

array

, $attribs = array())

gravatar() : 
magic
method , $attribs = array())

Returns

, $placement = Zend_View_Helper_Placeholder_Container_Abstract::APPEND)

headMeta() : 
magic
method , $placement = Zend_View_Helper_Placeholder_Container_Abstract::APPEND)

Returns

, $type = 'text/javascript')

headScript() : 
magic
method , $type = 'text/javascript')

Returns

)

headStyle() : 
magic
method )

Returns

headTitle()

headTitle() : 
magic
method

Returns

, array $params = array(), $content = null)

htmlFlash() : 
magic
method , array $params = array(), $content = null)

Returns

htmlList()

htmlList() : 
magic
method

Returns

, array $params = array(), $content = null)

htmlObject() : 
magic
method , array $params = array(), $content = null)

Returns

, array $params = array(), $content = null)

htmlPage() : 
magic
method , array $params = array(), $content = null)

Returns

, array $params = array(), $content = null)

htmlQuicktime() : 
magic
method , array $params = array(), $content = null)

Returns

Allow custom object initialization when extending Zend_View_Abstract or Zend_View

init() : void
Inherited

Triggered by __construct() as its final action.

, $type = 'text/javascript')

inlineScript() : 
magic
method , $type = 'text/javascript')

Returns

Return status of LFI protection flag

isLfiProtectionOn() : boolean
Inherited

Returns

boolean

json()

json() : 
magic
method

Returns

layout()

layout() : 
magic
method

Returns

navigation()

navigation() : 
magic
method

Returns

paginationControl()

paginationControl() : 
magic
method

Returns

partial()

partial() : 
magic
method

Returns

partialLoop()

partialLoop() : 
magic
method

Returns

placeholder()

placeholder() : 
magic
method

Returns

Registers a helper object, bypassing plugin loader

registerHelper(\Zend_View_Helper_Abstract|object $helper, string $name) : \Zend_View_Abstract
Inherited

Parameters

$helper

\Zend_View_Helper_Abstractobject

$name

string

Exceptions

\Zend_View_Exception

Returns

\Zend_View_Abstract

Processes a view script and returns the output.

render(string $name) : string
Inherited
inherited_from \Zend_View_Interface::render()

Parameters

$name

string

The script name to process.

Returns

stringThe script output.

renderToPlaceholder()

renderToPlaceholder() : 
magic
method

Returns

serverUrl()

serverUrl() : 
magic
method

Returns

Given a base path, sets the script, helper, and filter paths relative to it

setBasePath(string $path, string $classPrefix = 'Zend_View') : \Zend_View_Abstract
Inherited

Assumes a directory structure of: basePath/ scripts/ helpers/ filters/

inherited_from \Zend_View_Interface::setBasePath()

Parameters

$path

string

$classPrefix

Returns

\Zend_View_Abstract

Set encoding to use with htmlentities() and htmlspecialchars()

setEncoding(string $encoding) : \Zend_View_Abstract
Inherited

Parameters

$encoding

string

Returns

\Zend_View_Abstract

Sets the _escape() callback.

setEscape(mixed $spec) : \Zend_View_Abstract
Inherited

Parameters

$spec

mixed

The callback for _escape() to use.

Returns

\Zend_View_Abstract

Resets the filter stack.

setFilter($name) : \Zend_View_Abstract
Inherited

To clear all filters, use Zend_View::setFilter(null).

Parameters

$name

Returns

\Zend_View_Abstract

Resets the stack of filter paths.

setFilterPath($path, string $classPrefix = 'Zend_View_Filter_') : \Zend_View_Abstract
Inherited

To clear all paths, use Zend_View::setFilterPath(null).

Parameters

$path

$classPrefix

string

The class prefix to apply to all elements in $path; defaults to Zend_View_Filter

Returns

\Zend_View_Abstract

Resets the stack of helper paths.

setHelperPath(string|array $path, string $classPrefix = 'Zend_View_Helper_') : \Zend_View_Abstract
Inherited

To clear all paths, use Zend_View::setHelperPath(null).

Parameters

$path

stringarray

The directory (-ies) to set as the path.

$classPrefix

string

The class prefix to apply to all elements in $path; defaults to Zend_View_Helper

Returns

\Zend_View_Abstract

Set LFI protection flag

setLfiProtection(boolean $flag) : \Zend_View_Abstract
Inherited

Parameters

$flag

boolean

Returns

\Zend_View_Abstract

Set plugin loader for a particular plugin type

setPluginLoader(\Zend_Loader_PluginLoader $loader, string $type) : \Zend_View_Abstract
Inherited

Parameters

$loader

\Zend_Loader_PluginLoader

$type

string

Returns

\Zend_View_Abstract

Resets the stack of view script paths.

setScriptPath($path) : \Zend_View_Abstract
Inherited

To clear all paths, use Zend_View::setScriptPath(null).

inherited_from \Zend_View_Interface::setScriptPath()

Parameters

$path

Returns

\Zend_View_Abstract

Set flag indicating if stream wrapper should be used if short_open_tag is off

setUseStreamWrapper(boolean $flag) : \Zend_View

Parameters

$flag

boolean

Returns

\Zend_View

Enable or disable strict vars

strictVars(boolean $flag = true) : \Zend_View_Abstract
Inherited

If strict variables are enabled, __get() will raise a notice when a variable is not defined.

Use in conjunction with the declareVars() helper to enforce strict variable handling in your view scripts.

Parameters

$flag

boolean

Returns

\Zend_View_Abstract

translate()

translate() : 
magic
method

Returns

, $name = null, $reset = false, $encode = true)

url() : 
magic
method , $name = null, $reset = false, $encode = true)

Returns

Should the stream wrapper be used if short_open_tag is off?

useStreamWrapper() : boolean

Returns

boolean

userAgent()

userAgent() : 
magic
method

Returns

Includes the view script in a scope with only public $this variables.

_run() 
inherited_from \Zend_View_Abstract::_run()

Use to include the view script in a scope that only allows public members.

_run() : mixed
Inherited

Returns

mixed

Finds a view script from the available directories.

_script(string $name) : void
Inherited

Parameters

$name

string

The base name of the script.

Adds paths to the path stack in LIFO order.

_addPath(string $type, string|array $path, string $prefix = null) : void
Inherited

Zend_View::_addPath($type, 'dirname') adds one directory to the path stack.

Zend_View::_addPath($type, $array) adds one directory for each array element value.

In the case of filter and helper paths, $prefix should be used to specify what class prefix to use with the given path.

Parameters

$type

string

The path type ('script', 'helper', or 'filter').

$path

stringarray

The path specification.

$prefix

string

Class prefix to use with path (helpers and filters only)

Add a prefixPath for a plugin type

_addPluginPath(string $type, string $classPrefix, array $paths) : \Zend_View_Abstract
Inherited

Parameters

$type

string

$classPrefix

string

$paths

array

Returns

\Zend_View_Abstract

Applies the filter callback to a buffer.

_filter(string $buffer) : string
Inherited

Parameters

$buffer

string

The buffer contents.

Returns

stringThe filtered buffer.

Return all paths for a given path type

_getPaths(string $type) : array
Inherited

Parameters

$type

string

The path type ('helper', 'filter', 'script')

Returns

array

Retrieve a plugin object

_getPlugin(string $type, string $name) : object
Inherited

Parameters

$type

string

$name

string

Returns

object

Get a path to a given plugin class of a given type

_getPluginPath(string $type, string $name) : string | false
Inherited

Parameters

$type

string

$name

string

Returns

stringfalse

Register filter class as loaded

_setFilterClass(string $name, string $class, string $file) : void
Inherited

Parameters

$name

string

$class

string

$file

string

path to class file

Register helper class as loaded

_setHelperClass(string $name, string $class, string $file) : void
Inherited

Parameters

$name

string

$class

string

$file

string

path to class file

Resets the path stack for helpers and filters.

_setPath(string $type, string|array $path, string $classPrefix = null
Inherited

Parameters

$type

string

The path type ('helper' or 'filter').

$path

stringarray

The directory (-ies) to set as the path.

$classPrefix

string

Class prefix to apply to elements of $path

 Properties

 

Encoding to use in escaping mechanisms; defaults to utf-8

$_encoding : string

Default

'UTF-8'
 

Callback for escaping.

$_escape : string

Default

'htmlspecialchars'
 

Script file name to execute

$_file : string

Default

null
 

Stack of Zend_View_Filter names to apply as filters.

$_filter : array

Default

array()
 

Stack of Zend_View_Filter objects that have been loaded

$_filterClass : array

Default

array()
 

Map of filter => class pairs to help in determining filter class from name

$_filterLoaded : array

Default

array()
 

Map of filter => classfile pairs to aid in determining filter classfile

$_filterLoadedDir : array

Default

array()
 

Instances of helper objects.

$_helper : array

Default

array()
 

Map of helper => class pairs to help in determining helper class from name

$_helperLoaded : array

Default

array()
 

Map of helper => classfile pairs to aid in determining helper classfile

$_helperLoadedDir : array

Default

array()
 

Flag indicating whether or not LFI protection for rendering view scripts is enabled

$_lfiProtectionOn : boolean

Default

true
 

Plugin types

$_loaderTypes : array

Default

array('filter', 'helper')
 

Plugin loaders

$_loaders : array

Default

array()
 

Path stack for script, helper, and filter directories.

$_path : array

Default

array('script' => array(), 'helper' => array(), 'filter' => array())
 

Strict variables flag; when on, undefined variables accessed in the view scripts will trigger notices

$_strictVars : boolean

Default

false
 

Whether or not to use stream wrapper if short_open_tag is false

$_useStreamWrapper : boolean

Default

false
 

Whether or not to use streams to mimic short tags

$_useViewStream : boolean

Default

false