1 | <?php defined('SYSPATH') OR die('No direct script access.'); |
||
12 | abstract class Kohana_Jam_Form_General extends Jam_Form { |
||
13 | |||
14 | /** |
||
15 | * The template for a single html row |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $_template = '<div class="row :name-field :type-field :with-errors">:label<div class="input"><div class="field-wrapper">:field:errors</div>:help</div></div>'; |
||
19 | |||
20 | /** |
||
21 | * Getter / setter for the template |
||
22 | * @param string|null $template |
||
23 | * @return Jam_Form|string |
||
24 | */ |
||
25 | 1 | public function template($template = NULL) |
|
34 | |||
35 | /** |
||
36 | * Generate a html row with the input field, label, help and error messages |
||
37 | * |
||
38 | * @param string $type the html field (input, hidden, textarea ...) |
||
39 | * @param string $name the name of the attribute of the bound Jam_Model |
||
40 | * @param array $options options for the input field, you can also change the 'label', and add 'help' message |
||
41 | * @param array $attributes html attributes for the input field |
||
42 | * @return string |
||
43 | */ |
||
44 | 1 | public function row($type, $name, array $options = array(), array $attributes = array(), $template = NULL) |
|
64 | |||
65 | /** |
||
66 | * Return the html for the errors for a given field |
||
67 | * @param string $name |
||
68 | * @return string |
||
69 | */ |
||
70 | 1 | public function errors($name) |
|
75 | |||
76 | /** |
||
77 | * Return an html label linked to a given input field |
||
78 | * @param string $name the name of the Jam_Model attribute |
||
79 | * @param string $label the text of the label, can be autogenerated if NULL |
||
80 | * @param array $attributes of the input field, extract the id from there |
||
81 | * @return string |
||
82 | */ |
||
83 | 2 | public function label($name, $label = NULL, array $attributes = array()) |
|
100 | |||
101 | /** |
||
102 | * HTML input text field |
||
103 | * |
||
104 | * @param string $name the name of the Jam_Model attribute |
||
105 | * @param array $options Not Used - for compatibility |
||
106 | * @param array $attributes HTML attributes for the field |
||
107 | * @return string |
||
108 | */ |
||
109 | 2 | public function input($name, array $options = array(), array $attributes = array()) |
|
115 | |||
116 | /** |
||
117 | * HTML input hidden field |
||
118 | * |
||
119 | * @param string $name the name of the Jam_Model attribute |
||
120 | * @param array $options Not Used - for compatibility |
||
121 | * @param array $attributes HTML attributes for the field |
||
122 | * @return string |
||
123 | */ |
||
124 | 1 | public function hidden($name, array $options = array(), array $attributes = array()) |
|
130 | |||
131 | |||
132 | /** |
||
133 | * HTML input hidden field for multiple values, renders all the nesessary hidden fields |
||
134 | * @param string $name |
||
135 | * @param array $options Not Used - for compatibility |
||
136 | * @param array $attributes HTML attributes for all the fields |
||
137 | * @return string |
||
138 | */ |
||
139 | public function hidden_list($name, array $options = array(), array $attributes = array()) |
||
150 | |||
151 | /** |
||
152 | * HTML input checkbox field |
||
153 | * |
||
154 | * @param string $name the name of the Jam_Model attribute |
||
155 | * @param array $options can change the value of the checkbox with 'value', defaults to 1 |
||
156 | * @param array $attributes HTML attributes for the field |
||
157 | * @return string |
||
158 | */ |
||
159 | 1 | public function checkbox($name, array $options = array(), array $attributes = array()) |
|
171 | |||
172 | /** |
||
173 | * HTML input radio field |
||
174 | * |
||
175 | * @param string $name the name of the Jam_Model attribute |
||
176 | * @param array $options must provide the value of the radio with 'value' |
||
177 | * @param array $attributes HTML attributes for the field |
||
178 | * @return string |
||
179 | */ |
||
180 | 1 | public function radio($name, array $options = array(), array $attributes = array()) |
|
193 | |||
194 | public function checkboxes($name, array $options = array(), array $attributes = array()) |
||
214 | |||
215 | public function radios($name, array $options = array(), array $attributes = array()) |
||
237 | |||
238 | /** |
||
239 | * HTML input file field |
||
240 | * |
||
241 | * @param string $name the name of the Jam_Model attribute |
||
242 | * @param array $options temp_source = TRUE, set this to add a spection hidden input to preserve the file upload on fiald validation |
||
243 | * @param array $attributes HTML attributes for the field |
||
244 | * @return string |
||
245 | */ |
||
246 | 1 | public function file($name, array $options = array(), array $attributes = array()) |
|
258 | |||
259 | /** |
||
260 | * HTML input password field |
||
261 | * @param string $name the name of the Jam_Model attribute |
||
262 | * @param array $options Not Used - for compatibility |
||
263 | * @param array $attributes HTML attributes for the field |
||
264 | * @return string |
||
265 | */ |
||
266 | public function password($name, array $options = array(), array $attributes = array()) |
||
272 | |||
273 | |||
274 | /** |
||
275 | * HTML input textarea field |
||
276 | * |
||
277 | * @param string $name the name of the Jam_Model attribute |
||
278 | * @param array $options Not Used - for compatibility |
||
279 | * @param array $attributes HTML attributes for the field |
||
280 | * @return string |
||
281 | */ |
||
282 | 1 | public function textarea($name, array $options = array(), array $attributes = array()) |
|
288 | |||
289 | /** |
||
290 | * HTML input select field |
||
291 | * available options |
||
292 | * - choices - this can be Jam_Query_Builder_Collection or a simple array |
||
293 | * - include_blank - bool|string - include an empty option |
||
294 | * |
||
295 | * @param string $name the name of the Jam_Model attribute |
||
296 | * @param array $options set the options of the select with 'choices' and 'include_blank' |
||
297 | * @param array $attributes HTML attributes for the field |
||
298 | * @return string |
||
299 | */ |
||
300 | 1 | public function select($name, array $options = array(), array $attributes = array()) |
|
323 | } // End Kohana_Jam_Field |
||
324 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.