Public Member Functions | Protected Member Functions

Zend_View_Abstract Class Reference

Inheritance diagram for Zend_View_Abstract:
Zend_View_Interface Zend_View

Public Member Functions

 __construct ($config=array())
 getEngine ()
 init ()
 __get ($key)
 __isset ($key)
 __set ($key, $val)
 __unset ($key)
 __call ($name, $args)
 setBasePath ($path, $classPrefix= 'Zend_View')
 addBasePath ($path, $classPrefix= 'Zend_View')
 addScriptPath ($path)
 setScriptPath ($path)
 getScriptPath ($name)
 getScriptPaths ()
 setPluginLoader (Zend_Loader_PluginLoader $loader, $type)
 getPluginLoader ($type)
 addHelperPath ($path, $classPrefix= 'Zend_View_Helper_')
 setHelperPath ($path, $classPrefix= 'Zend_View_Helper_')
 getHelperPath ($name)
 getHelperPaths ()
 getHelper ($name)
 getHelpers ()
 addFilterPath ($path, $classPrefix= 'Zend_View_Filter_')
 setFilterPath ($path, $classPrefix= 'Zend_View_Filter_')
 getFilterPath ($name)
 getFilter ($name)
 getFilters ()
 getFilterPaths ()
 getAllPaths ()
 addFilter ($name)
 setFilter ($name)
 setEscape ($spec)
 setLfiProtection ($flag)
 isLfiProtectionOn ()
 assign ($spec, $value=null)
 getVars ()
 clearVars ()
 render ($name)
 escape ($var)
 setEncoding ($encoding)
 getEncoding ()
 strictVars ($flag=true)

Protected Member Functions

 _script ($name)
 _run ()

Detailed Description

Definition at line 39 of file Abstract.php.


Constructor & Destructor Documentation

__construct ( config = array() )

Constructor.

Parameters:
array$configConfiguration key-value pairs.

Reimplemented in Zend_View.

Definition at line 147 of file Abstract.php.


Member Function Documentation

__call ( name,
args 
)

Accesses a helper object from within a script.

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

Parameters:
string$nameThe helper name.
array$argsThe parameters for the helper.
Returns:
string The result of the helper output.

Definition at line 331 of file Abstract.php.

__get ( key )

Prevent E_NOTICE for nonexistent values

If strictVars() is on, raises a notice.

Parameters:
string$key
Returns:
null

Definition at line 259 of file Abstract.php.

__isset ( key )

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

Parameters:
string$key
Returns:
boolean

Implements Zend_View_Interface.

Definition at line 275 of file Abstract.php.

__set ( key,
val 
)

Directly assigns a variable to the view script.

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.

Parameters:
string$keyThe variable name.
mixed$valThe variable value.
Returns:
void
Exceptions:
Zend_View_Exceptionif an attempt to set a private or protected member is detected

Implements Zend_View_Interface.

Definition at line 297 of file Abstract.php.

__unset ( key )

Allows unset() on object properties to work

Parameters:
string$key
Returns:
void

Implements Zend_View_Interface.

Definition at line 314 of file Abstract.php.

_run (  ) [abstract, protected]

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

Returns:
mixed

Reimplemented in Zend_View.

_script ( name ) [protected]

Finds a view script from the available directories.

Parameters:
$namestring The base name of the script.
Returns:
void

Definition at line 901 of file Abstract.php.

addBasePath ( path,
classPrefix = 'Zend_View' 
)

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

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

Parameters:
string$path
string$prefixPrefix to use for helper and filter paths
Returns:
Zend_View_Abstract

Implements Zend_View_Interface.

Definition at line 385 of file Abstract.php.

addFilter ( name )

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

Parameters:
string|arrayOne or more filters to add.
Returns:
Zend_View_Abstract

Definition at line 674 of file Abstract.php.

addFilterPath ( path,
classPrefix = 'Zend_View_Filter_' 
)

Adds to the stack of filter paths in LIFO order.

Parameters:
string|arrayThe directory (-ies) to add.
string$classPrefixClass prefix to use with classes in this directory; defaults to Zend_View_Filter
Returns:
Zend_View_Abstract

Definition at line 590 of file Abstract.php.

addHelperPath ( path,
classPrefix = 'Zend_View_Helper_' 
)

Adds to the stack of helper paths in LIFO order.

Parameters:
string|arrayThe directory (-ies) to add.
string$classPrefixClass prefix to use with classes in this directory; defaults to Zend_View_Helper
Returns:
Zend_View_Abstract

Definition at line 517 of file Abstract.php.

addScriptPath ( path )

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

Parameters:
string|arrayThe directory (-ies) to add.
Returns:
Zend_View_Abstract

Definition at line 403 of file Abstract.php.

assign ( spec,
value = null 
)

Assigns variables to the view script via differing strategies.

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 also:
__set()
Parameters:
string|arrayThe assignment strategy to use.
mixed(Optional) If assigning a named variable, use this as the value.
Returns:
Zend_View_Abstract Fluent interface
Exceptions:
Zend_View_Exceptionif $spec is neither a string nor an array, or if an attempt to set a private or protected member is detected

Implements Zend_View_Interface.

Definition at line 748 of file Abstract.php.

clearVars (  )

Clear all assigned variables

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

Returns:
void

Implements Zend_View_Interface.

Definition at line 808 of file Abstract.php.

escape ( var )

Escapes a value for output in a view script.

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

Parameters:
mixed$varThe output to escape.
Returns:
mixed The escaped value.

Definition at line 845 of file Abstract.php.

getAllPaths (  )

Return associative array of path types => paths

Returns:
array

Definition at line 660 of file Abstract.php.

getEncoding (  )

Return current escape encoding

Returns:
string

Definition at line 871 of file Abstract.php.

getEngine (  )

Return the template engine object

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

Returns:
Zend_View_Abstract

Implements Zend_View_Interface.

Definition at line 234 of file Abstract.php.

getFilter ( name )

Get a filter object by name

Parameters:
string$name
Returns:
object

Definition at line 628 of file Abstract.php.

getFilterPath ( name )

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

Parameters:
string$name
Returns:
string|false False on failure, path on success

Definition at line 617 of file Abstract.php.

getFilterPaths (  )

Returns an array of all currently set filter paths

Returns:
array

Definition at line 650 of file Abstract.php.

getFilters (  )

Return array of all currently active filters

Only returns those that have already been instantiated.

Returns:
array

Definition at line 640 of file Abstract.php.

getHelper ( name )

Get a helper by name

Parameters:
string$name
Returns:
object

Definition at line 565 of file Abstract.php.

getHelperPath ( name )

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

Parameters:
string$name
Returns:
string|false False on failure, path on success

Definition at line 544 of file Abstract.php.

getHelperPaths (  )

Returns an array of all currently set helper paths

Returns:
array

Definition at line 554 of file Abstract.php.

getHelpers (  )

Get array of all active helpers

Only returns those that have already been instantiated.

Returns:
array

Definition at line 577 of file Abstract.php.

getPluginLoader ( type )

Retrieve plugin loader for a specific plugin type

Parameters:
string$type
Returns:
Zend_Loader_PluginLoader

Definition at line 480 of file Abstract.php.

getScriptPath ( name )

Return full path to a view script specified by $name

Parameters:
string$name
Returns:
false|string False if script not found
Exceptions:
Zend_View_Exceptionif no script directory set

Definition at line 431 of file Abstract.php.

getScriptPaths (  )

Returns an array of all currently set script paths

Returns:
array

Implements Zend_View_Interface.

Definition at line 450 of file Abstract.php.

getVars (  )

Return list of all assigned variables

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

Returns:
array

Definition at line 788 of file Abstract.php.

init (  )

Allow custom object initialization when extending Zend_View_Abstract or Zend_View

Triggered by the constructor as its final action.

Returns:
void

Definition at line 247 of file Abstract.php.

isLfiProtectionOn (  )

Return status of LFI protection flag

Returns:
bool

Definition at line 726 of file Abstract.php.

render ( name )

Processes a view script and returns the output.

Parameters:
string$nameThe script script name to process.
Returns:
string The script output.

Implements Zend_View_Interface.

Definition at line 824 of file Abstract.php.

setBasePath ( path,
classPrefix = 'Zend_View' 
)

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

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

Parameters:
string$path
string$prefixPrefix to use for helper and filter paths
Returns:
Zend_View_Abstract

Implements Zend_View_Interface.

Definition at line 358 of file Abstract.php.

setEncoding ( encoding )

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

Parameters:
string$encoding
Returns:
Zend_View_Abstract

Definition at line 860 of file Abstract.php.

setEscape ( spec )

Sets the _escape() callback.

Parameters:
mixed$specThe callback for _escape() to use.
Returns:
Zend_View_Abstract

Definition at line 703 of file Abstract.php.

setFilter ( name )

Resets the filter stack.

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

Parameters:
string|arrayOne or more filters to set.
Returns:
Zend_View_Abstract

Definition at line 690 of file Abstract.php.

setFilterPath ( path,
classPrefix = 'Zend_View_Filter_' 
)

Resets the stack of filter paths.

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

Parameters:
string|arrayThe directory (-ies) to set as the path.
string$classPrefixThe class prefix to apply to all elements in $path; defaults to Zend_View_Filter
Returns:
Zend_View_Abstract

Definition at line 605 of file Abstract.php.

setHelperPath ( path,
classPrefix = 'Zend_View_Helper_' 
)

Resets the stack of helper paths.

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

Parameters:
string | array$pathThe directory (-ies) to set as the path.
string$classPrefixThe class prefix to apply to all elements in $path; defaults to Zend_View_Helper
Returns:
Zend_View_Abstract

Definition at line 532 of file Abstract.php.

setLfiProtection ( flag )

Set LFI protection flag

Parameters:
bool$flag
Returns:
Zend_View_Abstract

Definition at line 715 of file Abstract.php.

setPluginLoader ( Zend_Loader_PluginLoader loader,
type 
)

Set plugin loader for a particular plugin type

Parameters:
Zend_Loader_PluginLoader$loader
string$type
Returns:
Zend_View_Abstract

Definition at line 462 of file Abstract.php.

setScriptPath ( path )

Resets the stack of view script paths.

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

Parameters:
string|arrayThe directory (-ies) to set as the path.
Returns:
Zend_View_Abstract

Implements Zend_View_Interface.

Definition at line 417 of file Abstract.php.

strictVars ( flag = true )

Enable or disable strict vars

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:
boolean$flag
Returns:
Zend_View_Abstract

Definition at line 888 of file Abstract.php.


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