/zf/library/Zend/Form/Decorator/Interface.php

http://github.com/eryx/php-framework-benchmark · PHP · 123 lines · 15 code · 11 blank · 97 comment · 0 complexity · 750ee8fdb42837ff0644c4ffe980fa7d MD5 · raw file

  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Form
  17. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. */
  20. /**
  21. * Zend_Form_Decorator_Interface
  22. *
  23. * @category Zend
  24. * @package Zend_Form
  25. * @subpackage Decorator
  26. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  27. * @license http://framework.zend.com/license/new-bsd New BSD License
  28. * @version $Id: Interface.php 23775 2011-03-01 17:25:24Z ralph $
  29. */
  30. interface Zend_Form_Decorator_Interface
  31. {
  32. /**
  33. * Constructor
  34. *
  35. * Accept options during initialization.
  36. *
  37. * @param array|Zend_Config $options
  38. * @return void
  39. */
  40. public function __construct($options = null);
  41. /**
  42. * Set an element to decorate
  43. *
  44. * While the name is "setElement", a form decorator could decorate either
  45. * an element or a form object.
  46. *
  47. * @param mixed $element
  48. * @return Zend_Form_Decorator_Interface
  49. */
  50. public function setElement($element);
  51. /**
  52. * Retrieve current element
  53. *
  54. * @return mixed
  55. */
  56. public function getElement();
  57. /**
  58. * Set decorator options from an array
  59. *
  60. * @param array $options
  61. * @return Zend_Form_Decorator_Interface
  62. */
  63. public function setOptions(array $options);
  64. /**
  65. * Set decorator options from a config object
  66. *
  67. * @param Zend_Config $config
  68. * @return Zend_Form_Decorator_Interface
  69. */
  70. public function setConfig(Zend_Config $config);
  71. /**
  72. * Set a single option
  73. *
  74. * @param string $key
  75. * @param mixed $value
  76. * @return Zend_Form_Decorator_Interface
  77. */
  78. public function setOption($key, $value);
  79. /**
  80. * Retrieve a single option
  81. *
  82. * @param string $key
  83. * @return mixed
  84. */
  85. public function getOption($key);
  86. /**
  87. * Retrieve decorator options
  88. *
  89. * @return array
  90. */
  91. public function getOptions();
  92. /**
  93. * Delete a single option
  94. *
  95. * @param string $key
  96. * @return bool
  97. */
  98. public function removeOption($key);
  99. /**
  100. * Clear all options
  101. *
  102. * @return Zend_Form_Decorator_Interface
  103. */
  104. public function clearOptions();
  105. /**
  106. * Render the element
  107. *
  108. * @param string $content Content to decorate
  109. * @return string
  110. */
  111. public function render($content);
  112. }