web/lib/Zend/View/Helper/FormSubmit.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_View
    16  * @package    Zend_View
    17  * @subpackage Helper
    17  * @subpackage Helper
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: FormSubmit.php 23403 2010-11-19 19:23:29Z bittarman $
    20  * @version    $Id: FormSubmit.php 24750 2012-05-05 01:24:21Z adamlundrigan $
    21  */
    21  */
    22 
    22 
    23 
    23 
    24 /**
    24 /**
    25  * Abstract class for extension
    25  * Abstract class for extension
    31  * Helper to generate a "submit" button
    31  * Helper to generate a "submit" button
    32  *
    32  *
    33  * @category   Zend
    33  * @category   Zend
    34  * @package    Zend_View
    34  * @package    Zend_View
    35  * @subpackage Helper
    35  * @subpackage Helper
    36  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    36  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    37  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    37  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    38  */
    38  */
    39 class Zend_View_Helper_FormSubmit extends Zend_View_Helper_FormElement
    39 class Zend_View_Helper_FormSubmit extends Zend_View_Helper_FormElement
    40 {
    40 {
    41     /**
    41     /**
    65 
    65 
    66         if ($id) {
    66         if ($id) {
    67             $id = ' id="' . $this->view->escape($id) . '"';
    67             $id = ' id="' . $this->view->escape($id) . '"';
    68         }
    68         }
    69 
    69 
    70         // XHTML or HTML end tag?
       
    71         $endTag = ' />';
       
    72         if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) {
       
    73             $endTag= '>';
       
    74         }
       
    75 
       
    76         // Render the button.
    70         // Render the button.
    77         $xhtml = '<input type="submit"'
    71         $xhtml = '<input type="submit"'
    78                . ' name="' . $this->view->escape($name) . '"'
    72                . ' name="' . $this->view->escape($name) . '"'
    79                . $id
    73                . $id
    80                . ' value="' . $this->view->escape($value) . '"'
    74                . ' value="' . $this->view->escape($value) . '"'
    81                . $disabled
    75                . $disabled
    82                . $this->_htmlAttribs($attribs)
    76                . $this->_htmlAttribs($attribs)
    83                . $endTag;
    77                . $this->getClosingBracket();
    84 
    78 
    85         return $xhtml;
    79         return $xhtml;
    86     }
    80     }
    87 }
    81 }