1 <?php
2 3 4 5 6 7 8
9
10 Yii::import('bootstrap.widgets.input.BootInput');
11
12 13 14 15
16 class TbInputVertical extends TbInput
17 {
18 19 20 21
22 protected function checkBox()
23 {
24 $attribute = $this->attribute;
25 echo '<label class="checkbox" for="'.$this->getAttributeId($attribute).'">';
26 echo $this->form->checkBox($this->model, $this->attribute, $this->htmlOptions).PHP_EOL;
27 echo $this->model->getAttributeLabel($attribute);
28 echo $this->getError().$this->getHint();
29 echo '</label>';
30 }
31
32 33 34 35
36 protected function checkBoxList()
37 {
38 echo $this->getLabel();
39 echo $this->form->checkBoxList($this->model, $this->attribute, $this->data, $this->htmlOptions);
40 echo $this->getError().$this->getHint();
41 }
42
43 44 45 46
47 protected function checkBoxListInline()
48 {
49 $this->htmlOptions['inline'] = true;
50 $this->checkBoxList();
51 }
52
53 54 55 56
57 protected function dropDownList()
58 {
59 echo $this->getLabel();
60 echo $this->form->dropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions);
61 echo $this->getError().$this->getHint();
62 }
63
64 65 66 67
68 protected function fileField()
69 {
70 echo $this->getLabel();
71 echo $this->form->fileField($this->model, $this->attribute, $this->htmlOptions);
72 echo $this->getError().$this->getHint();
73 }
74
75 76 77 78
79 protected function passwordField()
80 {
81 echo $this->getLabel();
82 echo $this->getPrepend();
83 echo $this->form->passwordField($this->model, $this->attribute, $this->htmlOptions);
84 echo $this->getAppend();
85 echo $this->getError().$this->getHint();
86 }
87
88 89 90 91
92 protected function radioButton()
93 {
94 $attribute = $this->attribute;
95 echo '<label class="radio" for="'.$this->getAttributeId($attribute).'">';
96 echo $this->form->radioButton($this->model, $this->attribute, $this->htmlOptions).PHP_EOL;
97 echo $this->model->getAttributeLabel($attribute);
98 echo $this->getError().$this->getHint();
99 echo '</label>';
100 }
101
102 103 104 105
106 protected function radioButtonList()
107 {
108 echo $this->getLabel();
109 echo $this->form->radioButtonList($this->model, $this->attribute, $this->data, $this->htmlOptions);
110 echo $this->getError().$this->getHint();
111 }
112
113 114 115 116
117 protected function radioButtonListInline()
118 {
119 $this->htmlOptions['inline'] = true;
120 $this->radioButtonList();
121 }
122
123 124 125 126
127 protected function textArea()
128 {
129 echo $this->getLabel();
130 echo $this->form->textArea($this->model, $this->attribute, $this->htmlOptions);
131 echo $this->getError().$this->getHint();
132 }
133
134 135 136 137
138 protected function textField()
139 {
140 echo $this->getLabel();
141 echo $this->getPrepend();
142 echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions);
143 echo $this->getAppend();
144 echo $this->getError().$this->getHint();
145 }
146
147 148 149 150
151 protected function captcha()
152 {
153 echo $this->getLabel().'<div class="captcha">';
154 echo '<div class="widget">'.$this->widget('CCaptcha', $this->captchaOptions, true).'</div>';
155 echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions);
156 echo $this->getError().$this->getHint();
157 echo '</div>';
158 }
159
160 161 162 163
164 protected function uneditableField()
165 {
166 echo $this->getLabel();
167 echo CHtml::tag('span', $this->htmlOptions, $this->model->{$this->attribute});
168 echo $this->getError().$this->getHint();
169 }
170 }
171