File indexing completed on 2024-12-22 05:36:42
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_Form 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 */ 0020 0021 /** 0022 * Zend_Form_Decorator_Interface 0023 * 0024 * @category Zend 0025 * @package Zend_Form 0026 * @subpackage Decorator 0027 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0028 * @license http://framework.zend.com/license/new-bsd New BSD License 0029 * @version $Id$ 0030 */ 0031 interface Zend_Form_Decorator_Interface 0032 { 0033 /** 0034 * Constructor 0035 * 0036 * Accept options during initialization. 0037 * 0038 * @param array|Zend_Config $options 0039 * @return void 0040 */ 0041 public function __construct($options = null); 0042 0043 /** 0044 * Set an element to decorate 0045 * 0046 * While the name is "setElement", a form decorator could decorate either 0047 * an element or a form object. 0048 * 0049 * @param mixed $element 0050 * @return Zend_Form_Decorator_Interface 0051 */ 0052 public function setElement($element); 0053 0054 /** 0055 * Retrieve current element 0056 * 0057 * @return mixed 0058 */ 0059 public function getElement(); 0060 0061 /** 0062 * Set decorator options from an array 0063 * 0064 * @param array $options 0065 * @return Zend_Form_Decorator_Interface 0066 */ 0067 public function setOptions(array $options); 0068 0069 /** 0070 * Set decorator options from a config object 0071 * 0072 * @param Zend_Config $config 0073 * @return Zend_Form_Decorator_Interface 0074 */ 0075 public function setConfig(Zend_Config $config); 0076 0077 /** 0078 * Set a single option 0079 * 0080 * @param string $key 0081 * @param mixed $value 0082 * @return Zend_Form_Decorator_Interface 0083 */ 0084 public function setOption($key, $value); 0085 0086 /** 0087 * Retrieve a single option 0088 * 0089 * @param string $key 0090 * @return mixed 0091 */ 0092 public function getOption($key); 0093 0094 /** 0095 * Retrieve decorator options 0096 * 0097 * @return array 0098 */ 0099 public function getOptions(); 0100 0101 /** 0102 * Delete a single option 0103 * 0104 * @param string $key 0105 * @return bool 0106 */ 0107 public function removeOption($key); 0108 0109 /** 0110 * Clear all options 0111 * 0112 * @return Zend_Form_Decorator_Interface 0113 */ 0114 public function clearOptions(); 0115 0116 /** 0117 * Render the element 0118 * 0119 * @param string $content Content to decorate 0120 * @return string 0121 */ 0122 public function render($content); 0123 }