SubForm.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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-2015 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. */
  20. /** Zend_Form */
  21. require_once 'Zend/Form.php';
  22. /**
  23. * Zend_Form_SubForm
  24. *
  25. * @category Zend
  26. * @package Zend_Form
  27. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  28. * @license http://framework.zend.com/license/new-bsd New BSD License
  29. * @version $Id$
  30. */
  31. class Zend_Form_SubForm extends Zend_Form
  32. {
  33. /**
  34. * Whether or not form elements are members of an array
  35. * @var bool
  36. */
  37. protected $_isArray = true;
  38. /**
  39. * Load the default decorators
  40. *
  41. * @return Zend_Form_SubForm
  42. */
  43. public function loadDefaultDecorators()
  44. {
  45. if ($this->loadDefaultDecoratorsIsDisabled()) {
  46. return $this;
  47. }
  48. $decorators = $this->getDecorators();
  49. if (empty($decorators)) {
  50. $this->addDecorator('FormElements')
  51. ->addDecorator('HtmlTag', array('tag' => 'dl'))
  52. ->addDecorator('Fieldset')
  53. ->addDecorator('DtDdWrapper');
  54. }
  55. return $this;
  56. }
  57. }