문제

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;" />
도움이 되었습니까?

해결책

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.

다른 팁

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' ));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top