我无法设置表单的 id 或提交按钮的类。我看到了遵循我的代码的示例,但我没有得到任何设置。
我正在使用 cakePHP 2.5。
<?php
echo $this->Form->postLink(
'Confirm',
array('controller' => 'assets', 'action' => 'delete'),
array('id' => 'testId', 'class' => 'btn btn-confirm')
);
?>
我得到的是
<form action="/assets/ajax_delete/56.json" name="post_53ac1bb05415c464261170" id="post_53ac1bb05415c464261170" style="display:none;" method="post">
<input type="hidden" name="_method" value="POST">
</form>
<a href="#" onclick="document.post_53ac1bb05415c464261170.submit(); event.returnValue = false; return false;">Confirm</a>