Domanda

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;" />
È stato utile?

Soluzione

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.

Altri suggerimenti

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' ));
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top