HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
forms.php
Go to the documentation of this file.
1 <?php
2 /* @var $this SiteController */
3 
4 $this->pageTitle=Yii::app()->name . ' - Forms';
5 $this->breadcrumbs=array(
6  'Forms',
7 );
8 ?>
9 
10 <div class="page-header">
11  <h1>Forms</h1>
12 </div>
13 
14 <div class="row-fluid">
15  <div class="span6">
16 
17 <?php
18  $this->beginWidget('zii.widgets.CPortlet', array(
19  'title'=>"Text fields",
20  ));
21 
22 ?>
23 <?php
24 echo(CHtml::beginForm());
25 
26 echo(CHtml::label('Normal field', 'name'));
27 echo(CHtml::textField('name'));
28 
29 echo(CHtml::label('Password input', 'name'));
30 echo(CHtml::passwordField('name'));
31 
32 echo(CHtml::label('With placeholder', 'name'));
33 echo(CHtml::textField('name', 'this is placeholder text'));
34 
35 echo(CHtml::label('Read only field', 'name'));
36 echo(CHtml::textField('name','',array('readonly'=>'readonly')));
37 
38 echo(CHtml::label('Disabled field', 'name'));
39 echo(CHtml::textField('name','',array('disabled'=>'disabled')));
40 
41 echo(CHtml::label('Max lenght', 'name'));
42 echo(CHtml::textField('name','Max length is 10',array('maxlength'=>'10')));
43 
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'));
48 echo '</div>';
49 
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>';
54 echo '</div>';
55 
56 echo(CHtml::endForm());
57 ?>
58 
59 <?php $this->endWidget();?>
60 
61  </div>
62  <div class="span6">
63  <?php
64  $this->beginWidget('zii.widgets.CPortlet', array(
65  'title'=>"Text fields",
66  ));
67 
68  ?>
69  <?php
70  echo(CHtml::label('List box', 'name'));
71  echo(CHtml::listBox('name','',array('1'=>'One','2'=>'Two','3'=>'Three','4'=>'Four','5'=>'Five')));
72 
73  echo(CHtml::label('Text Area', 'name'));
74  echo(CHtml::textArea('name'));
75 
76  echo(CHtml::label('File field', 'name'));
77  echo(CHtml::fileField('name','',array('class'=>'btn')));
78 
79  echo(CHtml::label('Radio button', 'name'));
80  echo(CHtml::radioButton('name'));
81 
82  echo '<br><br>';
83 
84  echo(CHtml::label('Check box', 'name'));
85  echo(CHtml::checkBox('name'));
86 
87  ?>
88  <?php $this->endWidget();?>
89  </div>
90 </div>
91 
92 <div class="row-fluid">
93  <div class="span12">
94  <?php
95  $this->beginWidget('zii.widgets.CPortlet', array(
96  'title'=>"Control sizing - Block level inputs",
97  ));
98 
99  ?>
100  <p>
101  Make any <code>&lt;input&gt;</code> or <code>&lt;textarea&gt;</code> element behave like a block level element.
102  </p>
103  <?php
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')));
106  ?>
107 
108  <?php $this->endWidget();?>
109  </div>
110 </div>
111 
112 <div class="row-fluid">
113  <div class="span12">
114  <?php
115  $this->beginWidget('zii.widgets.CPortlet', array(
116  'title'=>"Control sizing - Relative sizing",
117  ));
118 
119  ?>
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>
121  <?php
122  echo(CHtml::textField('name','.input-mini',array('class'=>'input-mini')));
123  ?>
124  <br />
125  <?php
126  echo(CHtml::textField('name','.input-small',array('class'=>'input-small')));
127  ?>
128  <br />
129  <?php
130  echo(CHtml::textField('name','.input-medium',array('class'=>'input-medium')));
131  ?>
132  <br />
133  <?php
134  echo(CHtml::textField('name','.input-large',array('class'=>'input-large')));
135  ?>
136  <br />
137  <?php
138  echo(CHtml::textField('name','.input-xlarge',array('class'=>'input-xlarge')));
139  ?>
140  <br />
141  <?php
142  echo(CHtml::textField('name','.input-xxlarge',array('class'=>'input-xxlarge')));
143  ?>
144 
145  <?php $this->endWidget();?>
146  </div>
147 </div>
148 <div class="row-fluid">
149 
150  <?php
151  $this->beginWidget('zii.widgets.CPortlet', array(
152  'title'=>"Control sizing - Grid sizing",
153  ));
154 
155  ?>
156  <p>Use <code>.span1</code> to <code>.span12</code> for inputs that match the same sizes of the grid columns.</p>
157 
158  <?php
159  echo(CHtml::textField('name','.span1',array('class'=>'span1')));
160  ?>
161  <br />
162  <?php
163  echo(CHtml::textField('name','.span2',array('class'=>'span2')));
164  ?>
165  <br />
166  <?php
167  echo(CHtml::textField('name','.span3',array('class'=>'span3')));
168  ?>
169  <br /><?php
170  echo(CHtml::textField('name','.span4',array('class'=>'span4')));
171  ?>
172  <br /><?php
173  echo(CHtml::textField('name','.span5',array('class'=>'span5')));
174  ?>
175  <br /><?php
176  echo(CHtml::textField('name','.span6',array('class'=>'span6')));
177  ?>
178  <br /><?php
179  echo(CHtml::textField('name','.span7',array('class'=>'span7')));
180  ?>
181  <br /><?php
182  echo(CHtml::textField('name','.span8',array('class'=>'span8')));
183  ?>
184  <br /><?php
185  echo(CHtml::textField('name','.span9',array('class'=>'span9')));
186  ?>
187  <br /><?php
188  echo(CHtml::textField('name','.span10',array('class'=>'span10')));
189  ?>
190  <br /><?php
191  echo(CHtml::textField('name','.span11',array('class'=>'span11')));
192  ?>
193  <br />
194  <?php
195  echo(CHtml::textField('name','.span12',array('class'=>'span12')));
196  ?>
197 
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>
199 
200 
201 <div class="controls-row">
202  <?php
203  echo(CHtml::textField('name','.span5',array('class'=>'span5')));
204  ?>
205  <br />
206  <?php
207  echo(CHtml::textField('name','.span4',array('class'=>'span4')));
208  echo(CHtml::textField('name','.span1',array('class'=>'span1')));
209  ?>
210  <br />
211  <?php
212  echo(CHtml::textField('name','.span3',array('class'=>'span3')));
213  echo(CHtml::textField('name','.span2',array('class'=>'span2')));
214  ?>
215  <br />
216  <?php
217  echo(CHtml::textField('name','.span2',array('class'=>'span2')));
218  echo(CHtml::textField('name','.span3',array('class'=>'span3')));
219  ?>
220  <br />
221  <?php
222  echo(CHtml::textField('name','.span1',array('class'=>'span1')));
223  echo(CHtml::textField('name','.span4',array('class'=>'span4')));
224  ?>
225 </div>
226 
227  <pre>&lt;div class=&quot;controls-row&quot;&gt;<br /> &lt;?php<br /> echo(CHtml::textField('name','.span5',array('class'=&gt;'span5')));<br /> ?&gt;<br /> &lt;br /&gt;<br /> &lt;?php<br /> echo(CHtml::textField('name','.span4',array('class'=&gt;'span4'))); <br /> echo(CHtml::textField('name','.span1',array('class'=&gt;'span1')));<br /> ?&gt;<br /> &lt;br /&gt;<br /> &lt;?php<br /> echo(CHtml::textField('name','.span3',array('class'=&gt;'span3'))); <br /> echo(CHtml::textField('name','.span2',array('class'=&gt;'span2')));<br /> ?&gt;<br /> &lt;br /&gt;<br /> &lt;?php<br /> echo(CHtml::textField('name','.span2',array('class'=&gt;'span2'))); <br /> echo(CHtml::textField('name','.span3',array('class'=&gt;'span3')));<br /> ?&gt;<br /> &lt;br /&gt;<br /> &lt;?php<br /> echo(CHtml::textField('name','.span1',array('class'=&gt;'span1'))); <br /> echo(CHtml::textField('name','.span4',array('class'=&gt;'span4')));<br /> ?&gt;<br />&lt;/div&gt;</pre>
228 
229  <?php $this->endWidget();?>
230 
231 </div>