在 cakephp 中
echo $this->Form->input('email', array('type' => 'email'));
将呈现
<div class="input email">
<label for="UserEmail">Email</label>
<input type="email" name="data[User][email]" value="" id="UserEmail" />
如何做到这一点
<input type="email" name="data[User][email]" value="" id="UserEmail" class="input_class" style="some:style;" />
最佳答案
只需将“类”和/或“样式”参数添加到您的选项数组即可。
echo $this->Form->input('email', array('type' => 'email', 'class' => 'input_class', 'style' => 'some:style' ));
参见 the FormHelper documentation获取所有选项的列表。
关于html - 如何修改cakephp输入中的参数(样式,类..)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16405567/