Showing posts with label php Zend\Form openTag() method not including all attributes. Show all posts
Showing posts with label php Zend\Form openTag() method not including all attributes. Show all posts

Zend\Form openTag() method not including all attributes

Wednesday, November 4, 2015
<?php
$form->setAttribute('action', $this->url('customer', array('action' => 'index')));
$form->setAttribute('ng-submit', 'validateForm()');
$form->prepare();
var_dump($form->getAttributes());
echo $this->form()->openTag($form);
?>


Well, as you can see I'm setting some form attributes ans the dumping them with var_dump($form->getAttributes()); and here is the result :



array (size=4)
'method' => string 'get' (length=3)
'name' => string 'searchCustomerForm' (length=18)
'action' => string '/customer' (length=9)
'ng-submit' => string 'validateForm()' (length=4)


but the result form tag is :



<form id="searchCustomerForm" action="/customer" name="searchCustomerForm" method="get" class="ng-pristine ng-valid">  


the ng-submit attribute is missing!!



How Can I set form attributes?