[英]how to modify parameters like (style , class ..) in cakephp input?
in cakephp 在cakephp中
echo $this->Form->input('email', array('type' => 'email'));
will render 将呈现
<div class="input email">
<label for="UserEmail">Email</label>
<input type="email" name="data[User][email]" value="" id="UserEmail" />
how to make this like that 如何做到这样
<input type="email" name="data[User][email]" value="" id="UserEmail" class="input_class" style="some:style;" />
Just add a "class" and/or "style" argument to your options array. 只需在选项数组中添加“类”和/或“样式”参数即可。
echo $this->Form->input('email', array('type' => 'email', 'class' => 'input_class', 'style' => 'some:style' ));
See the the FormHelper documentation for a list of all options. 有关所有选项的列表,请参见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.