how to modify parameters like (style , class ..) in cakephp input?
15,626
Solution 1
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.
Solution 2
if you need only input without lable you can also try in this way
echo $this->Form->input('email', array('type' => 'email','div'=>false, 'class' => 'input_class', 'style' => 'some:style' ));
Author by
Alsemany
Updated on June 12, 2022Comments
-
Alsemany almost 2 years
in 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;" />
-
nullability over 9 years
some:style
is what was used in the original post.