2
0

Button.php 1.9 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 View
  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. * @version $Id$
  21. */
  22. /** Zend_Dojo_View_Helper_Dijit */
  23. require_once 'Zend/Dojo/View/Helper/Dijit.php';
  24. /**
  25. * Dojo Button dijit
  26. *
  27. * @uses Zend_Dojo_View_Helper_Dijit
  28. * @package Zend_Dojo
  29. * @subpackage View
  30. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. */
  33. class Zend_Dojo_View_Helper_Button extends Zend_Dojo_View_Helper_Dijit
  34. {
  35. /**
  36. * Dijit being used
  37. * @var string
  38. */
  39. protected $_dijit = 'dijit.form.Button';
  40. /**
  41. * Dojo module to use
  42. * @var string
  43. */
  44. protected $_module = 'dijit.form.Button';
  45. /**
  46. * dijit.form.Button
  47. *
  48. * @param string $id
  49. * @param string $value
  50. * @param array $params Parameters to use for dijit creation
  51. * @param array $attribs HTML attributes
  52. * @return string
  53. */
  54. public function button($id, $value = null, array $params = array(), array $attribs = array())
  55. {
  56. $attribs['name'] = $id;
  57. if (!array_key_exists('id', $attribs)) {
  58. $attribs['id'] = $id;
  59. }
  60. $attribs = $this->_prepareDijit($attribs, $params, 'element');
  61. return $this->view->formButton($id, $value, $attribs);
  62. }
  63. }