DisplayGroup.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_Dojo
  17. * @subpackage Form
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /** Zend_Form_DisplayGroup */
  22. require_once 'Zend/Form/DisplayGroup.php';
  23. /**
  24. * Dijit-enabled DisplayGroup
  25. *
  26. * @uses Zend_Form_DisplayGroup
  27. * @package Zend_Dojo
  28. * @subpackage Form
  29. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  30. * @license http://framework.zend.com/license/new-bsd New BSD License
  31. * @version $Id$
  32. */
  33. class Zend_Dojo_Form_DisplayGroup extends Zend_Form_DisplayGroup
  34. {
  35. /**
  36. * Constructor
  37. *
  38. * @param string $name
  39. * @param Zend_Loader_PluginLoader $loader
  40. * @param array|Zend_Config|null $options
  41. * @return void
  42. */
  43. public function __construct($name, Zend_Loader_PluginLoader $loader, $options = null)
  44. {
  45. parent::__construct($name, $loader, $options);
  46. $this->addPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator');
  47. }
  48. /**
  49. * Set the view object
  50. *
  51. * Ensures that the view object has the dojo view helper path set.
  52. *
  53. * @param Zend_View_Interface $view
  54. * @return Zend_Dojo_Form_Element_Dijit
  55. */
  56. public function setView(Zend_View_Interface $view = null)
  57. {
  58. if (null !== $view) {
  59. if (false === $view->getPluginLoader('helper')->getPaths('Zend_Dojo_View_Helper')) {
  60. $view->addHelperPath('Zend/Dojo/View/Helper', 'Zend_Dojo_View_Helper');
  61. }
  62. }
  63. return parent::setView($view);
  64. }
  65. }