繁体   English   中英

如何修改cakephp输入中的参数(样式,类..)?

[英]how to modify parameters like (style , class ..) in cakephp input?

在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' ));

有关所有选项的列表,请参见FormHelper文档

如果您只需要输入而没有标签,您也可以这样尝试

echo $this->Form->input('email', array('type' => 'email','div'=>false, 'class' => 'input_class', 'style' => 'some:style' ));

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM