Pergunta

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;" />
Foi útil?

Solução

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.

Outras dicas

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' ));
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top