View Helpers have some initial helpers, such as formButton and formText.
As the reference said:
formText($name, $value, $attribs): Creates an <input type="text" />
element.
But I find something not like it on my PC. I write below code in a view file:
<?php
echo $this->formText('email', '[email protected]', array('size' => 32));
?>
The HTML is as below:
<input type="text" name="email" id="email" value="[email protected]" size="32">
There isn't a '/' at the end.It should be :
<input type="text" name="email" id="email" value="[email protected]" size="32"/>
So is there something wrong? My version is ZF1.12 and PHP5.4.
No. ZF checks whether the doctype you appended to the view is XHTML and adds the forward slash only if this is true.
Check out Zend_View_Helper_HtmlElement::getClosingBracket