public function render(Zend_View_Interface $view = null)
{
/**
* Getting elements.
*/
$elements = $this->getElements();
foreach ($elements as $eachElement) {
/**
* Add required attribute to required elements
* https://github.com/manticorp
*/
if ($eachElement->isRequired()) {
$eachElement->setAttrib('required', '');
}
/**
* Removing label from buttons before render.
*/
if ($eachElement instanceof Zend_Form_Element_Submit) {
$eachElement->removeDecorator('Label');
}
/**
* No decorators for hidden elements
*/
if ($eachElement instanceof Zend_Form_Element_Hidden) {
$eachElement->clearDecorators()->addDecorator('ViewHelper');
}
/**
* No decorators for hash elements
*/
if ($eachElement instanceof Zend_Form_Element_Hash) {
$eachElement->clearDecorators()->addDecorator('ViewHelper');
}
}
/**
* Rendering.
*/
return parent::render($view);
}