[ZF-10089] Zend_Log
[zend/radio.git] / library / Zend / View / Helper / FormReset.php
blob8481cc18489d71f45eed295301a9fde8c0204a80
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
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.
15 * @category Zend
16 * @package Zend_View
17 * @subpackage Helper
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id$
24 /**
25 * Abstract class for extension
27 require_once 'Zend/View/Helper/FormElement.php';
30 /**
31 * Helper to generate a "reset" button
33 * @category Zend
34 * @package Zend_View
35 * @subpackage Helper
36 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
37 * @license http://framework.zend.com/license/new-bsd New BSD License
39 class Zend_View_Helper_FormReset extends Zend_View_Helper_FormElement
41 /**
42 * Generates a 'reset' button.
44 * @access public
46 * @param string|array $name If a string, the element name. If an
47 * array, all other parameters are ignored, and the array elements
48 * are extracted in place of added parameters.
50 * @param mixed $value The element value.
52 * @param array $attribs Attributes for the element tag.
54 * @return string The element XHTML.
56 public function formReset($name = '', $value = 'Reset', $attribs = null)
58 $info = $this->_getInfo($name, $value, $attribs);
59 extract($info); // name, value, attribs, options, listsep, disable
61 // check if disabled
62 $disabled = '';
63 if ($disable) {
64 $disabled = ' disabled="disabled"';
67 // get closing tag
68 $endTag = '>';
69 if ($this->view->doctype()->isXhtml()) {
70 $endTag = ' />';
73 // Render button
74 $xhtml = '<input type="reset"'
75 . ' name="' . $this->view->escape($name) . '"'
76 . ' id="' . $this->view->escape($id) . '"'
77 . $disabled;
79 // add a value if one is given
80 if (! empty($value)) {
81 $xhtml .= ' value="' . $this->view->escape($value) . '"';
84 // add attributes, close, and return
85 $xhtml .= $this->_htmlAttribs($attribs) . $endTag;
86 return $xhtml;