1
<?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);
?>
嗯,你可以看到我設置某種形式的屬性ANS與var_dump($form->getAttributes());
傾倒他們,這裏是結果:的Zend 表openTag()方法不包括所有的屬性
array (size=4)
'method' => string 'get' (length=3)
'name' => string 'searchCustomerForm' (length=18)
'action' => string '/customer' (length=9)
'ng-submit' => string 'validateForm()' (length=4)
但結果form
標記爲:
<form id="searchCustomerForm" action="/customer" name="searchCustomerForm" method="get" class="ng-pristine ng-valid">
ng-submit屬性丟失!!
如何設置form
屬性?
很清楚,謝謝 – Seif