Abstract Class Zend_View_Abstract

Description

Implements interfaces:

Abstract class for Zend_View to help enforce private constructs.

  • copyright: Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  • abstract:
  • license: New BSD License

Located in /View/Abstract.php (line 38)


	
			
Direct descendents
Class Description
 class Zend_View Concrete class for handling view scripts.
Method Summary
 Zend_View_Abstract __construct ([array $config = array()])
 Zend_View_Abstract addBasePath (string $path, [ $classPrefix = 'Zend_View'], string $prefix)
 Zend_View_Abstract addFilter (string|array $name)
 Zend_View_Abstract addFilterPath (string|array $path, [string $classPrefix = 'Zend_View_Filter_'])
 Zend_View_Abstract addHelperPath (string|array $path, [string $classPrefix = 'Zend_View_Helper_'])
 Zend_View_Abstract addScriptPath (string|array $path)
 Zend_View_Abstract assign (string|array $spec, [mixed $value = null])
 void clearVars ()
 mixed escape (mixed $var)
 array getAllPaths ()
 string getEncoding ()
 object getFilter (string $name)
 string|false getFilterPath (string $name)
 array getFilterPaths ()
 array getFilters ()
 object getHelper (string $name)
 string|false getHelperPath (string $name)
 array getHelperPaths ()
 array getHelpers ()
 false|string getScriptPath (string $name)
 array getScriptPaths ()
 array getVars ()
 void init ()
 string render (string $name)
 Zend_View_Abstract setBasePath (string $path, [ $classPrefix = 'Zend_View'], string $prefix)
 Zend_View_Abstract setEncoding (string $encoding)
 Zend_View_Abstract setEscape (mixed $spec)
 Zend_View_Abstract setFilter (string|array $name)
 Zend_View_Abstract setFilterPath (string|array $path, [string $classPrefix = 'Zend_View_Filter_'])
 Zend_View_Abstract setHelperPath (string|array $path, [string $classPrefix = 'Zend_View_Helper_'])
 Zend_View_Abstract setPluginLoader ( $loader, string $type)
 Zend_View_Abstract setScriptPath (string|array $path)
 Zend_View_Abstract strictVars ([boolean $flag = true])
 mixed _run ()
 void _script ($name $name)
 string __call (string $name, array $args)
 null __get (string $key)
 boolean __isset (string $key)
 void __set (string $key, mixed $val)
 void __unset (string $key)
Methods
Constructor __construct (line 142)

Constructor.

  • access: public
Zend_View_Abstract __construct ([array $config = array()])
  • array $config: Configuration key-value pairs.

Redefined in descendants as:
addBasePath (line 363)

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

Assumes a directory structure of:

  1.  basePath/
  2.      scripts/
  3.      helpers/
  4.      filters/

  • access: public
Zend_View_Abstract addBasePath (string $path, [ $classPrefix = 'Zend_View'], string $prefix)
  • string $path
  • string $prefix: Prefix to use for helper and filter paths
  • $classPrefix

Implementation of:
Zend_View_Interface::addBasePath()
Add an additional path to view resources
addFilter (line 652)

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

  • access: public
Zend_View_Abstract addFilter (string|array $name)
  • string|array $name: One or more filters to add.
addFilterPath (line 568)

Adds to the stack of filter paths in LIFO order.

  • access: public
Zend_View_Abstract addFilterPath (string|array $path, [string $classPrefix = 'Zend_View_Filter_'])
  • string $classPrefix: Class prefix to use with classes in this directory; defaults to Zend_View_Filter
  • string|array $path: The directory (-ies) to add.
addHelperPath (line 495)

Adds to the stack of helper paths in LIFO order.

  • access: public
Zend_View_Abstract addHelperPath (string|array $path, [string $classPrefix = 'Zend_View_Helper_'])
  • string $classPrefix: Class prefix to use with classes in this directory; defaults to Zend_View_Helper
  • string|array $path: The directory (-ies) to add.
addScriptPath (line 381)

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

  • access: public
Zend_View_Abstract addScriptPath (string|array $path)
  • string|array $path: The directory (-ies) to add.
assign (line 704)

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).

  • return: Fluent interface
  • see: Zend_View_Abstract::__set()
  • throws: 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
  • access: public
Zend_View_Abstract assign (string|array $spec, [mixed $value = null])
  • string|array $spec: The assignment strategy to use.
  • mixed $value: (Optional) If assigning a named variable, use this as the value.

Implementation of:
Zend_View_Interface::assign()
Assign variables to the view script via differing strategies.
clearVars (line 764)

Clear all assigned variables

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

  • access: public
void clearVars ()

Implementation of:
Zend_View_Interface::clearVars()
Clear all assigned variables
escape (line 801)

Escapes a value for output in a view script.

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

  • return: The escaped value.
  • access: public
mixed escape (mixed $var)
  • mixed $var: The output to escape.
getAllPaths (line 638)

Return associative array of path types => paths

  • access: public
array getAllPaths ()
getEncoding (line 827)

Return current escape encoding

  • access: public
string getEncoding ()
getEngine (line 212)

Return the template engine object

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

  • access: public
Zend_View_Abstract getEngine ()

Implementation of:
Zend_View_Interface::getEngine()
Return the template engine object, if any
getFilter (line 606)

Get a filter object by name

  • access: public
object getFilter (string $name)
  • string $name
getFilterPath (line 595)

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

  • return: False on failure, path on success
  • access: public
string|false getFilterPath (string $name)
  • string $name
getFilterPaths (line 628)

Returns an array of all currently set filter paths

  • access: public
array getFilterPaths ()
getFilters (line 618)

Return array of all currently active filters

Only returns those that have already been instantiated.

  • access: public
array getFilters ()
getHelper (line 543)

Get a helper by name

  • access: public
object getHelper (string $name)
  • string $name
getHelperPath (line 522)

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

  • return: False on failure, path on success
  • access: public
string|false getHelperPath (string $name)
  • string $name
getHelperPaths (line 532)

Returns an array of all currently set helper paths

  • access: public
array getHelperPaths ()
getHelpers (line 555)

Get array of all active helpers

Only returns those that have already been instantiated.

  • access: public
array getHelpers ()
getPluginLoader (line 458)

Retrieve plugin loader for a specific plugin type

  • access: public
Zend_Loader_PluginLoader getPluginLoader (string $type)
  • string $type
getScriptPath (line 409)

Return full path to a view script specified by $name

  • return: False if script not found
  • throws: Zend_View_Exception if no script directory set
  • access: public
false|string getScriptPath (string $name)
  • string $name
getScriptPaths (line 428)

Returns an array of all currently set script paths

  • access: public
array getScriptPaths ()

Implementation of:
Zend_View_Interface::getScriptPaths()
Retrieve all view script paths
getVars (line 744)

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.

  • access: public
array getVars ()
init (line 225)

Allow custom object initialization when extending Zend_View_Abstract or Zend_View

Triggered by the constructor as its final action.

  • access: public
void init ()
render (line 780)

Processes a view script and returns the output.

  • return: The script output.
  • access: public
string render (string $name)
  • string $name: The script script name to process.

Implementation of:
Zend_View_Interface::render()
Processes a view script and returns the output.
setBasePath (line 336)

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

Assumes a directory structure of:

  1.  basePath/
  2.      scripts/
  3.      helpers/
  4.      filters/

  • access: public
Zend_View_Abstract setBasePath (string $path, [ $classPrefix = 'Zend_View'], string $prefix)
  • string $path
  • string $prefix: Prefix to use for helper and filter paths
  • $classPrefix

Implementation of:
Zend_View_Interface::setBasePath()
Set a base path to all view resources
setEncoding (line 816)

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

  • access: public
Zend_View_Abstract setEncoding (string $encoding)
  • string $encoding
setEscape (line 681)

Sets the _escape() callback.

  • access: public
Zend_View_Abstract setEscape (mixed $spec)
  • mixed $spec: The callback for _escape() to use.
setFilter (line 668)

Resets the filter stack.

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

  • access: public
Zend_View_Abstract setFilter (string|array $name)
  • string|array $name: One or more filters to set.
setFilterPath (line 583)

Resets the stack of filter paths.

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

  • access: public
Zend_View_Abstract setFilterPath (string|array $path, [string $classPrefix = 'Zend_View_Filter_'])
  • string $classPrefix: The class prefix to apply to all elements in $path; defaults to Zend_View_Filter
  • string|array $path: The directory (-ies) to set as the path.
setHelperPath (line 510)

Resets the stack of helper paths.

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

  • access: public
Zend_View_Abstract setHelperPath (string|array $path, [string $classPrefix = 'Zend_View_Helper_'])
  • 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
setPluginLoader (line 440)

Set plugin loader for a particular plugin type

  • access: public
Zend_View_Abstract setPluginLoader ( $loader, string $type)
setScriptPath (line 395)

Resets the stack of view script paths.

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

  • access: public
Zend_View_Abstract setScriptPath (string|array $path)
  • string|array $path: The directory (-ies) to set as the path.

Implementation of:
Zend_View_Interface::setScriptPath()
Set the path to find the view script used by render()
strictVars (line 844)

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.

  • access: public
Zend_View_Abstract strictVars ([boolean $flag = true])
  • boolean $flag
_run (line 1131)

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

  • abstract:
  • access: protected
mixed _run ()

Redefined in descendants as:
  • Zend_View::_run() : Includes the view script in a scope with only public $this variables.
_script (line 857)

Finds a view script from the available directories.

  • access: protected
void _script ($name $name)
  • $name $name: string The base name of the script.
__call (line 309)

Accesses a helper object from within a script.

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

  • return: The result of the helper output.
  • access: public
string __call (string $name, array $args)
  • string $name: The helper name.
  • array $args: The parameters for the helper.
__get (line 237)

Prevent E_NOTICE for nonexistent values

If strictVars() is on, raises a notice.

  • access: public
null __get (string $key)
  • string $key
__isset (line 253)

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

  • access: public
boolean __isset (string $key)
  • string $key

Implementation of:
Zend_View_Interface::__isset()
Allows testing with empty() and isset() to work
__set (line 275)

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.

  • throws: Zend_View_Exception if an attempt to set a private or protected member is detected
  • access: public
void __set (string $key, mixed $val)
  • string $key: The variable name.
  • mixed $val: The variable value.

Implementation of:
Zend_View_Interface::__set()
Assign a variable to the view
__unset (line 292)

Allows unset() on object properties to work

  • access: public
void __unset (string $key)
  • string $key

Implementation of:
Zend_View_Interface::__unset()
Allows unset() on object properties to work

Documentation generated on Mon, 25 Aug 2008 23:26:55 +0400 by phpDocumentor 1.4.1