Abstract Class Zend_View_Abstract

Description

Implements interfaces:

Abstract class for Zend_View to help enforce private constructs.

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

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


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

Constructor.

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

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

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

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

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

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

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

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

Return associative array of path types => paths

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

Return current escape encoding

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

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

Get a filter object by name

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

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

Returns an array of all currently set filter paths

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

Return array of all currently active filters

Only returns those that have already been instantiated.

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

Get a helper by name

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

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

Returns an array of all currently set helper paths

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

Get array of all active helpers

Only returns those that have already been instantiated.

  • access: public
array getHelpers ()
getScriptPath (line 349)

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

Returns an array of all currently set script paths

  • access: public
array getScriptPaths ()
getVars (line 679)

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

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

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

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)
  • string $path
setEncoding (line 751)

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

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

Sets the _escape() callback.

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

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

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

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
setScriptPath (line 335)

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

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

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

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

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

Prevent E_NOTICE for nonexistent values

If strictVars() is on, raises a notice.

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

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

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

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 Sat, 05 May 2007 11:51:43 -0700 by phpDocumentor 1.3.2