Zend Framework
1.12
|
Public Member Functions | |
__construct ($config=array()) | |
Constructor. | |
getEngine () | |
Return the template engine object. | |
init () | |
Allow custom object initialization when extending Zend_View_Abstract or Zend_View. | |
__get ($key) | |
Prevent E_NOTICE for nonexistent values. | |
__isset ($key) | |
Allows testing with empty() and isset() to work inside templates. | |
__set ($key, $val) | |
Directly assigns a variable to the view script. | |
__unset ($key) | |
Allows unset() on object properties to work. | |
__call ($name, $args) | |
Accesses a helper object from within a script. | |
setBasePath ($path, $classPrefix= 'Zend_View') | |
Given a base path, sets the script, helper, and filter paths relative to it. | |
addBasePath ($path, $classPrefix= 'Zend_View') | |
Given a base path, add script, helper, and filter paths relative to it. | |
addScriptPath ($path) | |
Adds to the stack of view script paths in LIFO order. | |
setScriptPath ($path) | |
Resets the stack of view script paths. | |
getScriptPath ($name) | |
Return full path to a view script specified by $name. | |
getScriptPaths () | |
Returns an array of all currently set script paths. | |
setPluginLoader (Zend_Loader_PluginLoader $loader, $type) | |
Set plugin loader for a particular plugin type. | |
getPluginLoader ($type) | |
Retrieve plugin loader for a specific plugin type. | |
addHelperPath ($path, $classPrefix= 'Zend_View_Helper_') | |
Adds to the stack of helper paths in LIFO order. | |
setHelperPath ($path, $classPrefix= 'Zend_View_Helper_') | |
Resets the stack of helper paths. | |
getHelperPath ($name) | |
Get full path to a helper class file specified by $name. | |
getHelperPaths () | |
Returns an array of all currently set helper paths. | |
registerHelper ($helper, $name) | |
Registers a helper object, bypassing plugin loader. | |
getHelper ($name) | |
Get a helper by name. | |
getHelpers () | |
Get array of all active helpers. | |
addFilterPath ($path, $classPrefix= 'Zend_View_Filter_') | |
Adds to the stack of filter paths in LIFO order. | |
setFilterPath ($path, $classPrefix= 'Zend_View_Filter_') | |
Resets the stack of filter paths. | |
getFilterPath ($name) | |
Get full path to a filter class file specified by $name. | |
getFilter ($name) | |
Get a filter object by name. | |
getFilters () | |
Return array of all currently active filters. | |
getFilterPaths () | |
Returns an array of all currently set filter paths. | |
getAllPaths () | |
Return associative array of path types => paths. | |
addFilter ($name) | |
Add one or more filters to the stack in FIFO order. | |
setFilter ($name) | |
Resets the filter stack. | |
setEscape ($spec) | |
Sets the _escape() callback. | |
setLfiProtection ($flag) | |
Set LFI protection flag. | |
isLfiProtectionOn () | |
Return status of LFI protection flag. | |
assign ($spec, $value=null) | |
Assigns variables to the view script via differing strategies. | |
getVars () | |
Return list of all assigned variables. | |
clearVars () | |
Clear all assigned variables. | |
render ($name) | |
Processes a view script and returns the output. | |
escape ($var) | |
Escapes a value for output in a view script. | |
setEncoding ($encoding) | |
Set encoding to use with htmlentities() and htmlspecialchars() | |
getEncoding () | |
Return current escape encoding. | |
strictVars ($flag=true) | |
Enable or disable strict vars. | |
Protected Member Functions | |
_script ($name) | |
Finds a view script from the available directories. | |
_run () | |
Use to include the view script in a scope that only allows public members. | |
__construct | ( | $config = array() | ) |
Constructor.
array | $config | Configuration key-value pairs. |
__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.
string | $name | The helper name. |
array | $args | The parameters for the helper. |
__get | ( | $key | ) |
Prevent E_NOTICE for nonexistent values.
If strictVars() is on, raises a notice.
string | $key |
__isset | ( | $key | ) |
Allows testing with empty() and isset() to work inside templates.
string | $key |
Implements Zend_View_Interface.
__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.
string | $key | The variable name. |
mixed | $val | The variable value. |
Zend_View_Exception | if an attempt to set a private or protected member is detected |
Implements Zend_View_Interface.
__unset | ( | $key | ) |
Allows unset() on object properties to work.
string | $key |
Implements Zend_View_Interface.
|
abstractprotected |
Use to include the view script in a scope that only allows public members.
|
protected |
Finds a view script from the available directories.
string | $name | The base name of the script. |
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/
string | $path | |
string | $prefix | Prefix to use for helper and filter paths |
Implements Zend_View_Interface.
addFilter | ( | $name | ) |
Add one or more filters to the stack in FIFO order.
string|array | One or more filters to add. |
addFilterPath | ( | $path, | |
$classPrefix = 'Zend_View_Filter_' |
|||
) |
Adds to the stack of filter paths in LIFO order.
string|array | The directory (-ies) to add. | |
string | $classPrefix | Class prefix to use with classes in this directory; defaults to Zend_View_Filter |
addHelperPath | ( | $path, | |
$classPrefix = 'Zend_View_Helper_' |
|||
) |
Adds to the stack of helper paths in LIFO order.
string|array | The directory (-ies) to add. | |
string | $classPrefix | Class prefix to use with classes in this directory; defaults to Zend_View_Helper |
addScriptPath | ( | $path | ) |
Adds to the stack of view script paths in LIFO order.
string|array | The directory (-ies) to add. |
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).
string|array | The assignment strategy to use. |
mixed | (Optional) If assigning a named variable, use this as the value. |
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 |
Implements Zend_View_Interface.
clearVars | ( | ) |
Clear all assigned variables.
Clears all variables assigned to Zend_View either via assign() or property overloading (__set()).
Implements Zend_View_Interface.
escape | ( | $var | ) |
Escapes a value for output in a view script.
If escaping mechanism is one of htmlspecialchars or htmlentities, uses $_encoding setting.
mixed | $var | The output to escape. |
getAllPaths | ( | ) |
Return associative array of path types => paths.
getEncoding | ( | ) |
Return current escape encoding.
getEngine | ( | ) |
Return the template engine object.
Returns the object instance, as it is its own template engine
Implements Zend_View_Interface.
getFilter | ( | $name | ) |
Get a filter object by name.
string | $name |
getFilterPath | ( | $name | ) |
Get full path to a filter class file specified by $name.
string | $name |
getFilterPaths | ( | ) |
Returns an array of all currently set filter paths.
getFilters | ( | ) |
Return array of all currently active filters.
Only returns those that have already been instantiated.
getHelper | ( | $name | ) |
Get a helper by name.
string | $name |
getHelperPath | ( | $name | ) |
Get full path to a helper class file specified by $name.
string | $name |
getHelperPaths | ( | ) |
Returns an array of all currently set helper paths.
getHelpers | ( | ) |
Get array of all active helpers.
Only returns those that have already been instantiated.
getPluginLoader | ( | $type | ) |
Retrieve plugin loader for a specific plugin type.
string | $type |
getScriptPath | ( | $name | ) |
Return full path to a view script specified by $name.
string | $name |
Zend_View_Exception | if no script directory set |
getScriptPaths | ( | ) |
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.
init | ( | ) |
Allow custom object initialization when extending Zend_View_Abstract or Zend_View.
Triggered by the constructor as its final action.
isLfiProtectionOn | ( | ) |
Return status of LFI protection flag.
registerHelper | ( | $helper, | |
$name | |||
) |
Registers a helper object, bypassing plugin loader.
Zend_View_Helper_Abstract | object | $helper | |
string | $name |
Zend_View_Exception |
render | ( | $name | ) |
Processes a view script and returns the output.
string | $name | The script name to process. |
Implements Zend_View_Interface.
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/
string | $path | |
string | $prefix | Prefix to use for helper and filter paths |
Implements Zend_View_Interface.
setEncoding | ( | $encoding | ) |
Set encoding to use with htmlentities() and htmlspecialchars()
string | $encoding |
setEscape | ( | $spec | ) |
Sets the _escape() callback.
mixed | $spec | The callback for _escape() to use. |
setFilter | ( | $name | ) |
Resets the filter stack.
To clear all filters, use Zend_View::setFilter(null).
string|array | One or more filters to set. |
setFilterPath | ( | $path, | |
$classPrefix = 'Zend_View_Filter_' |
|||
) |
Resets the stack of filter paths.
To clear all paths, use Zend_View::setFilterPath(null).
string|array | The directory (-ies) to set as the path. | |
string | $classPrefix | The class prefix to apply to all elements in $path; defaults to Zend_View_Filter |
setHelperPath | ( | $path, | |
$classPrefix = 'Zend_View_Helper_' |
|||
) |
Resets the stack of helper paths.
To clear all paths, use Zend_View::setHelperPath(null).
string | array | $path | The directory (-ies) to set as the path. |
string | $classPrefix | The class prefix to apply to all elements in $path; defaults to Zend_View_Helper |
setLfiProtection | ( | $flag | ) |
setPluginLoader | ( | Zend_Loader_PluginLoader | $loader, |
$type | |||
) |
Set plugin loader for a particular plugin type.
Zend_Loader_PluginLoader | $loader | |
string | $type |
setScriptPath | ( | $path | ) |
Resets the stack of view script paths.
To clear all paths, use Zend_View::setScriptPath(null).
string|array | The directory (-ies) to set as the path. |
Implements Zend_View_Interface.
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.
boolean | $flag |