Quantcast

Form div styling

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Form div styling

André Luis
Hi people, it´s me bothering again hehehe

I have 2 doubts, but same subject.

When i create a input using $this->Form->input('name') for example, it outputs something like this:

<div class="input text">
<label>Name</label>
<input type="text" />
</div>

If is use a class as option, it will put the class at <input>, What i need is to use another class directly in <div>, like the example:

<div class="input text customclass">
<label>Name</label>
<input type="text" />
</div>

Is there anyway to do this?

AND, is there anyway to output the formated like this?
<div class="input text">
<label>Name</label>
<div class="input"><input type="text" /></div>
</div>

--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Form div styling

Thiago Belem
Maybe something like this:

echo $this->Form->input('name', array('div' => array('class' => 'div-class'), 'before' => '<div class="input">', 'after' => '</div>'))

Please check the cookbook:

--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Form div styling

André Luis
Thanks again Thiago, it worked as i excpected, just instead of 'before' i´ve used 'between', them it wraped only the select, so i could style it as i wanted.

You´re the master!

Em quinta-feira, 16 de agosto de 2012 12h12min57s UTC-3, Thiago Belem escreveu:
Maybe something like this:

echo $this->Form->input('name', array('div' => array('class' => 'div-class'), 'before' => '<div class="input">', 'after' => '</div>'))

Please check the cookbook:

--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
 
 
Loading...