View/Interface.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_View
- Version
- $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_View_Interface
Interface class for Zend_View compatible template engine implementations
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Methods

__isset(string $key) : booleanAllows testing with empty() and isset() to work
| Name | Type | Description |
|---|---|---|
| $key | string |
| Type | Description |
|---|---|
| boolean |

__set(string $key, mixed $val) : voidAssign a variable to the view
| Name | Type | Description |
|---|---|---|
| $key | string | The variable name. |
| $val | mixed | The variable value. |

__unset(string $key) : voidAllows unset() on object properties to work
| Name | Type | Description |
|---|---|---|
| $key | string |

addBasePath(string $path, string $classPrefix = 'Zend_View') : voidAdd an additional path to view resources
| Name | Type | Description |
|---|---|---|
| $path | string | |
| $classPrefix | string |

assign(string | array $spec, mixed $value = null) : voidAssign variables to the view script via differing strategies.
Suggested implementation is to allow setting a specific key to the specified value, OR passing an array of key => value pairs to set en masse.
| Name | Type | Description |
|---|---|---|
| $spec | string | array | The assignment strategy to use (key or array of key => value pairs) |
| $value | mixed | (Optional) If assigning a named variable, use this as the value. |
- See
- \global\__set()

getEngine() : mixedReturn the template engine object, if any
If using a third-party template engine, such as Smarty, patTemplate, phplib, etc, return the template engine object. Useful for calling methods on these objects, such as for setting filters, modifiers, etc.
| Type | Description |
|---|---|
| mixed |

render(string $name) : stringProcesses a view script and returns the output.
| Name | Type | Description |
|---|---|---|
| $name | string | The script name to process. |
| Type | Description |
|---|---|
| string | The script output. |

setBasePath(string $path, string $classPrefix = 'Zend_View') : voidSet a base path to all view resources
| Name | Type | Description |
|---|---|---|
| $path | string | |
| $classPrefix | string |