【发布时间】:2011-07-27 12:34:24
【问题描述】:
我正在对CakePHP 进行一些练习,我想从我从Form->create() 创建的表单中删除我通常避免使用的HTML 元素,例如<legend> 和<fieldset>。
我看到有这样的方式:
<?php
echo $this->Form->create('User',
array (
'action' => 'login',
'inputDefaults' => array (
'fieldset' => false,
'legend' => false
)
));
echo $this->Form->inputs(array (
/*'legend' => __('Login', true),*/
'username',
'password'
));
echo $this->Form->end('Login');
?>
如果我写这个,<legend> 和 <fieldset> 将改为可见。
是否存在删除它们的特定选项?
<form accept-charset="utf-8" action="/site.com/users/login" method="post" id="UserLoginForm">
<div style="display: none;"><input type="hidden" value="POST" name="_method"></div>
<!-- hoto to remove this --><fieldset><legend>New User</legend><!-- end of removing -->
<div class="input text required">
<label for="UserUsername">Username</label><input type="text" id="UserUsername" maxlength="255" name="data[User][username]">
</div>
<div class="input password required"><label for="UserPassword">Password</label><input type="password" id="UserPassword" name="data[User][password]"></div>
<!-- hoto to remove this --></fieldset><!-- end of removing -->
<div class="submit"><input type="submit" value="Accedi"></div>
</form>
【问题讨论】: