10 <div
class=
"page-header">
14 <div
class=
"row-fluid">
18 $this->beginWidget(
'zii.widgets.CPortlet', array(
19 'title'=>
"Text fields",
24 echo(CHtml::beginForm());
26 echo(CHtml::label(
'Normal field',
'name'));
27 echo(CHtml::textField(
'name'));
29 echo(CHtml::label(
'Password input',
'name'));
30 echo(CHtml::passwordField(
'name'));
32 echo(CHtml::label(
'With placeholder',
'name'));
33 echo(CHtml::textField(
'name',
'this is placeholder text'));
35 echo(CHtml::label(
'Read only field',
'name'));
36 echo(CHtml::textField(
'name',
'',array(
'readonly'=>
'readonly')));
38 echo(CHtml::label(
'Disabled field',
'name'));
39 echo(CHtml::textField(
'name',
'',array(
'disabled'=>
'disabled')));
41 echo(CHtml::label(
'Max lenght',
'name'));
42 echo(CHtml::textField(
'name',
'Max length is 10',array(
'maxlength'=>
'10')));
44 echo
'<div class="input-prepend">';
45 echo(CHtml::label(
'Prepended text',
'name'));
46 echo
'<span class="add-on">$</span>';
47 echo(CHtml::textField(
'name'));
50 echo
'<div class="input-append">';
51 echo(CHtml::label(
'Append text',
'name'));
52 echo(CHtml::textField(
'name'));
53 echo
'<span class="add-on">.00</span>';
56 echo(CHtml::endForm());
59 <?php $this->endWidget();?>
64 $this->beginWidget(
'zii.widgets.CPortlet', array(
65 'title'=>
"Text fields",
70 echo(CHtml::label(
'List box',
'name'));
71 echo(CHtml::listBox(
'name',
'',array(
'1'=>
'One',
'2'=>
'Two',
'3'=>
'Three',
'4'=>
'Four',
'5'=>
'Five')));
73 echo(CHtml::label(
'Text Area',
'name'));
74 echo(CHtml::textArea(
'name'));
76 echo(CHtml::label(
'File field',
'name'));
77 echo(CHtml::fileField(
'name',
'',array(
'class'=>
'btn')));
79 echo(CHtml::label(
'Radio button',
'name'));
80 echo(CHtml::radioButton(
'name'));
84 echo(CHtml::label(
'Check box',
'name'));
85 echo(CHtml::checkBox(
'name'));
88 <?php $this->endWidget();?>
92 <div
class=
"row-fluid">
95 $this->beginWidget(
'zii.widgets.CPortlet', array(
96 'title'=>
"Control sizing - Block level inputs",
101 Make any <code><input></code> or <code><textarea></code> element behave like a block level element.
104 echo(CHtml::textField(
'name',
'.input-block-level',array(
'class'=>
'input-block-level')));
105 echo(CHtml::textArea(
'name',
'.input-block-level',array(
'class'=>
'input-block-level',
'rows'=>
'6')));
108 <?php $this->endWidget();?>
112 <div
class=
"row-fluid">
115 $this->beginWidget(
'zii.widgets.CPortlet', array(
116 'title'=>
"Control sizing - Relative sizing",
120 <p>Use relative sizing classes like <code>.input-large</code> or match your inputs to the grid column sizes using <code>.span*</code> classes.</p>
122 echo(CHtml::textField(
'name',
'.input-mini',array(
'class'=>
'input-mini')));
126 echo(CHtml::textField(
'name',
'.input-small',array(
'class'=>
'input-small')));
130 echo(CHtml::textField(
'name',
'.input-medium',array(
'class'=>
'input-medium')));
134 echo(CHtml::textField(
'name',
'.input-large',array(
'class'=>
'input-large')));
138 echo(CHtml::textField(
'name',
'.input-xlarge',array(
'class'=>
'input-xlarge')));
142 echo(CHtml::textField(
'name',
'.input-xxlarge',array(
'class'=>
'input-xxlarge')));
145 <?php $this->endWidget();?>
148 <div
class=
"row-fluid">
151 $this->beginWidget(
'zii.widgets.CPortlet', array(
152 'title'=>
"Control sizing - Grid sizing",
156 <p>Use <code>.span1</code> to <code>.span12</code>
for inputs that match the same sizes of the grid columns.</p>
159 echo(CHtml::textField(
'name',
'.span1',array(
'class'=>
'span1')));
163 echo(CHtml::textField(
'name',
'.span2',array(
'class'=>
'span2')));
167 echo(CHtml::textField(
'name',
'.span3',array(
'class'=>
'span3')));
170 echo(CHtml::textField(
'name',
'.span4',array(
'class'=>
'span4')));
173 echo(CHtml::textField(
'name',
'.span5',array(
'class'=>
'span5')));
176 echo(CHtml::textField(
'name',
'.span6',array(
'class'=>
'span6')));
179 echo(CHtml::textField(
'name',
'.span7',array(
'class'=>
'span7')));
182 echo(CHtml::textField(
'name',
'.span8',array(
'class'=>
'span8')));
185 echo(CHtml::textField(
'name',
'.span9',array(
'class'=>
'span9')));
188 echo(CHtml::textField(
'name',
'.span10',array(
'class'=>
'span10')));
191 echo(CHtml::textField(
'name',
'.span11',array(
'class'=>
'span11')));
195 echo(CHtml::textField(
'name',
'.span12',array(
'class'=>
'span12')));
198 <p>For multiple grid inputs per line, <strong>use the <code>.controls-row</code> modifier
class for proper spacing</strong>. It floats the inputs to collapse white-space, sets the proper margins, and the clears the float.</p>
201 <div class=
"controls-row">
203 echo(CHtml::textField(
'name',
'.span5',array(
'class'=>
'span5')));
207 echo(CHtml::textField(
'name',
'.span4',array(
'class'=>
'span4')));
208 echo(CHtml::textField(
'name',
'.span1',array(
'class'=>
'span1')));
212 echo(CHtml::textField(
'name',
'.span3',array(
'class'=>
'span3')));
213 echo(CHtml::textField(
'name',
'.span2',array(
'class'=>
'span2')));
217 echo(CHtml::textField(
'name',
'.span2',array(
'class'=>
'span2')));
218 echo(CHtml::textField(
'name',
'.span3',array(
'class'=>
'span3')));
222 echo(CHtml::textField(
'name',
'.span1',array(
'class'=>
'span1')));
223 echo(CHtml::textField(
'name',
'.span4',array(
'class'=>
'span4')));
227 <pre><div
class="controls-row"><br /> <?php<br /> echo(CHtml::textField(
'name',
'.span5',array(
'class'=>
'span5')));<br /> ?><br /> <br /><br /> <?php<br /> echo(CHtml::textField(
'name',
'.span4',array(
'class'=>
'span4'))); <br /> echo(CHtml::textField(
'name',
'.span1',array(
'class'=>
'span1')));<br /> ?><br /> <br /><br /> <?php<br /> echo(CHtml::textField(
'name',
'.span3',array(
'class'=>
'span3'))); <br /> echo(CHtml::textField(
'name',
'.span2',array(
'class'=>
'span2')));<br /> ?><br /> <br /><br /> <?php<br /> echo(CHtml::textField(
'name',
'.span2',array(
'class'=>
'span2'))); <br /> echo(CHtml::textField(
'name',
'.span3',array(
'class'=>
'span3')));<br /> ?><br /> <br /><br /> <?php<br /> echo(CHtml::textField(
'name',
'.span1',array(
'class'=>
'span1'))); <br /> echo(CHtml::textField(
'name',
'.span4',array(
'class'=>
'span4')));<br /> ?><br /></div></pre>
229 <?php $this->endWidget();?>