web/lib/Zend/View/Helper/Form.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  * @version    $Id: Form.php 20096 2010-01-06 02:05:09Z bkarwin $
    19  * @version    $Id: Form.php 24593 2012-01-05 20:35:02Z matthew $
    20  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    21  */
    21  */
    22 
    22 
    23 /** Zend_View_Helper_FormElement */
    23 /** Zend_View_Helper_FormElement */
    24 require_once 'Zend/View/Helper/FormElement.php';
    24 require_once 'Zend/View/Helper/FormElement.php';
    26 /**
    26 /**
    27  * Helper for rendering HTML forms
    27  * Helper for rendering HTML forms
    28  *
    28  *
    29  * @package    Zend_View
    29  * @package    Zend_View
    30  * @subpackage Helper
    30  * @subpackage Helper
    31  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    31  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    33  */
    33  */
    34 class Zend_View_Helper_Form extends Zend_View_Helper_FormElement
    34 class Zend_View_Helper_Form extends Zend_View_Helper_FormElement
    35 {
    35 {
    36     /**
    36     /**
    53         }
    53         }
    54 
    54 
    55         if (array_key_exists('id', $attribs) && empty($attribs['id'])) {
    55         if (array_key_exists('id', $attribs) && empty($attribs['id'])) {
    56             unset($attribs['id']);
    56             unset($attribs['id']);
    57         }
    57         }
       
    58         
       
    59         if (!empty($name) && !($this->_isXhtml() && $this->_isStrictDoctype())) {
       
    60             $name = ' name="' . $this->view->escape($name) . '"';
       
    61         } else {
       
    62             $name = '';
       
    63         }
       
    64         
       
    65         if ( array_key_exists('name', $attribs) && empty($attribs['id'])) {
       
    66             unset($attribs['id']);
       
    67         }
    58 
    68 
    59         $xhtml = '<form'
    69         $xhtml = '<form'
    60                . $id
    70                . $id
       
    71                . $name
    61                . $this->_htmlAttribs($attribs)
    72                . $this->_htmlAttribs($attribs)
    62                . '>';
    73                . '>';
    63 
    74 
    64         if (false !== $content) {
    75         if (false !== $content) {
    65             $xhtml .= $content
    76             $xhtml .= $content