File indexing completed on 2024-05-12 06:03:16

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category   Zend
0016  * @package    Zend_View
0017  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0018  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0019  * @version    $Id$
0020  */
0021 
0022 
0023 /**
0024  * Interface class for Zend_View compatible template engine implementations
0025  *
0026  * @category   Zend
0027  * @package    Zend_View
0028  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0029  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0030  */
0031 interface Zend_View_Interface
0032 {
0033     /**
0034      * Return the template engine object, if any
0035      *
0036      * If using a third-party template engine, such as Smarty, patTemplate,
0037      * phplib, etc, return the template engine object. Useful for calling
0038      * methods on these objects, such as for setting filters, modifiers, etc.
0039      *
0040      * @return mixed
0041      */
0042     public function getEngine();
0043 
0044     /**
0045      * Set the path to find the view script used by render()
0046      *
0047      * @param string|array The directory (-ies) to set as the path. Note that
0048      * the concrete view implentation may not necessarily support multiple
0049      * directories.
0050      * @return void
0051      */
0052     public function setScriptPath($path);
0053 
0054     /**
0055      * Retrieve all view script paths
0056      *
0057      * @return array
0058      */
0059     public function getScriptPaths();
0060 
0061     /**
0062      * Set a base path to all view resources
0063      *
0064      * @param  string $path
0065      * @param  string $classPrefix
0066      * @return void
0067      */
0068     public function setBasePath($path, $classPrefix = 'Zend_View');
0069 
0070     /**
0071      * Add an additional path to view resources
0072      *
0073      * @param  string $path
0074      * @param  string $classPrefix
0075      * @return void
0076      */
0077     public function addBasePath($path, $classPrefix = 'Zend_View');
0078 
0079     /**
0080      * Assign a variable to the view
0081      *
0082      * @param string $key The variable name.
0083      * @param mixed $val The variable value.
0084      * @return void
0085      */
0086     public function __set($key, $val);
0087 
0088     /**
0089      * Allows testing with empty() and isset() to work
0090      *
0091      * @param string $key
0092      * @return boolean
0093      */
0094     public function __isset($key);
0095 
0096     /**
0097      * Allows unset() on object properties to work
0098      *
0099      * @param string $key
0100      * @return void
0101      */
0102     public function __unset($key);
0103 
0104     /**
0105      * Assign variables to the view script via differing strategies.
0106      *
0107      * Suggested implementation is to allow setting a specific key to the
0108      * specified value, OR passing an array of key => value pairs to set en
0109      * masse.
0110      *
0111      * @see __set()
0112      * @param string|array $spec The assignment strategy to use (key or array of key
0113      * => value pairs)
0114      * @param mixed $value (Optional) If assigning a named variable, use this
0115      * as the value.
0116      * @return void
0117      */
0118     public function assign($spec, $value = null);
0119 
0120     /**
0121      * Clear all assigned variables
0122      *
0123      * Clears all variables assigned to Zend_View either via {@link assign()} or
0124      * property overloading ({@link __get()}/{@link __set()}).
0125      *
0126      * @return void
0127      */
0128     public function clearVars();
0129 
0130     /**
0131      * Processes a view script and returns the output.
0132      *
0133      * @param string $name The script name to process.
0134      * @return string The script output.
0135      */
0136     public function render($name);
0137 }