Issues

ZF-12166: Form end tag is still generated if content is boolean false

Description

According to the docs for Zend_View helpers the form helper should not generate a form end tag if $content is boolean false.

form($name, $attribs, $content): Generates an XHTML form. All $attribs are escaped and rendered as XHTML attributes of the form tag. If $content is present and not a boolean FALSE, then that content is rendered within the start and close form tags; if $content is a boolean FALSE (the default), only the opening form tag is generated.

This is not the case. Despite the helper's content parameter is false by default the end tag is still generated.

Comments

patch for a fix

Index: Form.php

--- Form.php (revision 2) +++ Form.php (working copy) @@ -73,11 +73,9 @@ . '>';

     if (false !== $content) {

- $xhtml .= $content; + $xhtml .= $content . ''; }

  • $xhtml .= '';
  • return $xhtml; } }

Hi Jamie, to implement your patch a CLA is needed. Can you provide an unit test? Thanks.

I'll turn in the CLA as soon as I can. This can be closed. Referencing ZF-11747 which apparently fixed something that wasn't a bug and was working as intended in the documentation. According to the comments ZF-11747 has been reverted and the fix will be in 1.11.12.