<?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);
?>
好吧,正如您所看到的,我正在设置一些表单属性并将它们转储var_dump($form->getAttributes());
,结果如下:
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
属性?