1 | <?php namespace Cornford\Bootstrapper; |
||
8 | class Bootstrap extends BootstrapBase implements IncludableInterface, FormableInterface, LinkableInterface, AlertableInterface { |
||
9 | |||
10 | /** |
||
11 | * Include the Bootstrap CDN / Local CSS file |
||
12 | * |
||
13 | * @param string $type |
||
14 | * @param array $attributes |
||
15 | * |
||
16 | * @return string |
||
17 | */ |
||
18 | public function css($type = 'cdn', array $attributes = array()) |
||
34 | |||
35 | /** |
||
36 | * Include the Bootstrap CDN JS file. Include jQuery CDN / Local JS file. |
||
37 | * |
||
38 | * @param string $type |
||
39 | * @param array $attributes |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | public function js($type = 'cdn', array $attributes = array()) |
||
63 | |||
64 | /** |
||
65 | * Create a form text field. |
||
66 | * |
||
67 | * @param string $name |
||
68 | * @param string $label |
||
69 | * @param string $value |
||
70 | * @param \Illuminate\Support\MessageBag $errors |
||
71 | * @param array $options |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | public function text($name, $label = null, $value = null, $errors = null, array $options = array()) |
||
79 | |||
80 | /** |
||
81 | * Create a form password field. |
||
82 | * |
||
83 | * @param string $name |
||
84 | * @param string $label |
||
85 | * @param \Illuminate\Support\MessageBag $errors |
||
86 | * @param array $options |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | public function password($name, $label = null, $errors = null, array $options = array()) |
||
94 | |||
95 | /** |
||
96 | * Create a form email field. |
||
97 | * |
||
98 | * @param string $name |
||
99 | * @param string $label |
||
100 | * @param string $value |
||
101 | * @param \Illuminate\Support\MessageBag $errors |
||
102 | * @param array $options |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function email($name, $label = null, $value = null, $errors = null, array $options = array()) |
||
110 | |||
111 | /** |
||
112 | * Create a form telephone field. |
||
113 | * |
||
114 | * @param string $name |
||
115 | * @param string $label |
||
116 | * @param string $value |
||
117 | * @param \Illuminate\Support\MessageBag $errors |
||
118 | * @param array $options |
||
119 | * |
||
120 | * @return string |
||
121 | */ |
||
122 | public function telephone($name, $label = null, $value = null, $errors = null, array $options = array()) |
||
126 | |||
127 | /** |
||
128 | * Create a form number field. |
||
129 | * |
||
130 | * @param string $name |
||
131 | * @param string $label |
||
132 | * @param string $value |
||
133 | * @param \Illuminate\Support\MessageBag $errors |
||
134 | * @param array $options |
||
135 | * |
||
136 | * @return string |
||
137 | */ |
||
138 | public function number($name, $label = null, $value = null, $errors = null, array $options = array()) |
||
142 | |||
143 | /** |
||
144 | * Create a form url field. |
||
145 | * |
||
146 | * @param string $name |
||
147 | * @param string $label |
||
148 | * @param string $value |
||
149 | * @param \Illuminate\Support\MessageBag $errors |
||
150 | * @param array $options |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | public function url($name, $label = null, $value = null, $errors = null, array $options = array()) |
||
158 | |||
159 | /** |
||
160 | * Create a form range field. |
||
161 | * |
||
162 | * @param string $name |
||
163 | * @param string $label |
||
164 | * @param string $value |
||
165 | * @param \Illuminate\Support\MessageBag $errors |
||
166 | * @param array $options |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | public function range($name, $label = null, $value = null, $errors = null, array $options = array()) |
||
174 | |||
175 | /** |
||
176 | * Create a form search field. |
||
177 | * |
||
178 | * @param string $name |
||
179 | * @param string $label |
||
180 | * @param string $value |
||
181 | * @param \Illuminate\Support\MessageBag $errors |
||
182 | * @param array $options |
||
183 | * |
||
184 | * @return string |
||
185 | */ |
||
186 | public function search($name, $label = null, $value = null, $errors = null, array $options = array()) |
||
190 | |||
191 | /** |
||
192 | * Create a form file field. |
||
193 | * |
||
194 | * @param string $name |
||
195 | * @param string $label |
||
196 | * @param \Illuminate\Support\MessageBag $errors |
||
197 | * @param array $options |
||
198 | * |
||
199 | * @return string |
||
200 | */ |
||
201 | public function file($name, $label = null, $errors = null, array $options = array()) |
||
205 | |||
206 | /** |
||
207 | * Create a form date field. |
||
208 | * |
||
209 | * @param string $name |
||
210 | * @param string $label |
||
211 | * @param string $value |
||
212 | * @param \Illuminate\Support\MessageBag $errors |
||
213 | * @param array $options |
||
214 | * @param array $parameters |
||
215 | * |
||
216 | * @return string |
||
217 | */ |
||
218 | public function date($name, $label = null, $value = null, $errors = null, array $options = array(), array $parameters = array()) |
||
222 | |||
223 | /** |
||
224 | * Create a form datetime field. |
||
225 | * |
||
226 | * @param string $name |
||
227 | * @param string $label |
||
228 | * @param string $value |
||
229 | * @param \Illuminate\Support\MessageBag $errors |
||
230 | * @param array $options |
||
231 | * @param array $parameters |
||
232 | * |
||
233 | * @return string |
||
234 | */ |
||
235 | public function datetime($name, $label = null, $value = null, $errors = null, array $options = array(), array $parameters = array()) |
||
239 | |||
240 | /** |
||
241 | * Create a form time field. |
||
242 | * |
||
243 | * @param string $name |
||
244 | * @param string $label |
||
245 | * @param string $value |
||
246 | * @param \Illuminate\Support\MessageBag $errors |
||
247 | * @param array $options |
||
248 | * @param array $parameters |
||
249 | * |
||
250 | * @return string |
||
251 | */ |
||
252 | public function time($name, $label = null, $value = null, $errors = null, array $options = array(), array $parameters = array()) |
||
256 | |||
257 | /** |
||
258 | * Create a form textarea field. |
||
259 | * |
||
260 | * @param string $name |
||
261 | * @param string $label |
||
262 | * @param string $value |
||
263 | * @param \Illuminate\Support\MessageBag $errors |
||
264 | * @param array $options |
||
265 | * |
||
266 | * @return string |
||
267 | */ |
||
268 | public function textarea($name, $label = null, $value = null, $errors = null, array $options = array()) |
||
272 | |||
273 | /** |
||
274 | * Create a form select field. |
||
275 | * |
||
276 | * @param string $name |
||
277 | * @param string $label |
||
278 | * @param array $list |
||
279 | * @param string $selected |
||
280 | * @param \Illuminate\Support\MessageBag $errors |
||
281 | * @param array $options |
||
282 | * |
||
283 | * @return string |
||
284 | */ |
||
285 | public function select($name, $label = null, array $list = array(), $selected = null, $errors = null, array $options = array()) |
||
289 | |||
290 | /** |
||
291 | * Create a form field. |
||
292 | * |
||
293 | * @param string $name |
||
294 | * @param string $label |
||
295 | * @param integer $value |
||
296 | * @param string $checked |
||
297 | * @param array $options |
||
298 | * |
||
299 | * @return string |
||
300 | */ |
||
301 | public function checkbox($name, $label = null, $value = 1, $checked = null, array $options = array()) |
||
305 | |||
306 | /** |
||
307 | * Create a form radio field. |
||
308 | * |
||
309 | * @param string $name |
||
310 | * @param string $label |
||
311 | * @param string $value |
||
312 | * @param string $checked |
||
313 | * @param array $options |
||
314 | * |
||
315 | * @return string |
||
316 | */ |
||
317 | public function radio($name, $label = null, $value = null, $checked = null, array $options = array()) |
||
321 | |||
322 | /** |
||
323 | * Create a form submit button. |
||
324 | * |
||
325 | * @param string $value |
||
326 | * @param array $attributes |
||
327 | * |
||
328 | * @return string |
||
329 | */ |
||
330 | public function submit($value, array $attributes = array()) |
||
334 | |||
335 | /** |
||
336 | * Create a form button. |
||
337 | * |
||
338 | * @param string $value |
||
339 | * @param array $attributes |
||
340 | * |
||
341 | * @return string |
||
342 | */ |
||
343 | public function button($value, array $attributes = array()) |
||
347 | |||
348 | /** |
||
349 | * Create a form reset button. |
||
350 | * |
||
351 | * @param string $value |
||
352 | * @param array $attributes |
||
353 | * |
||
354 | * @return string |
||
355 | */ |
||
356 | public function reset($value, array $attributes = array()) |
||
360 | |||
361 | /** |
||
362 | * Create a button link to url. |
||
363 | * |
||
364 | * @param string $url |
||
365 | * @param string $title |
||
366 | * @param array $attributes |
||
367 | * @param string $secure |
||
368 | * |
||
369 | * @return string |
||
370 | */ |
||
371 | public function link($url, $title = null, array $attributes = array(), $secure = null) |
||
375 | |||
376 | /** |
||
377 | * Create a secure button link to url. |
||
378 | * |
||
379 | * @param string $url |
||
380 | * @param string $title |
||
381 | * @param array $attributes |
||
382 | * @param string $secure |
||
383 | * |
||
384 | * @return string |
||
385 | */ |
||
386 | public function secureLink($url, $title = null, array $attributes = array(), $secure = null) |
||
390 | |||
391 | /** |
||
392 | * Create a button link to route. |
||
393 | * |
||
394 | * @param string $name |
||
395 | * @param string $title |
||
396 | * @param array $parameters |
||
397 | * @param array $attributes |
||
398 | * |
||
399 | * @return string |
||
400 | */ |
||
401 | public function linkRoute($name, $title = null, array $parameters = array(), array $attributes = array()) |
||
405 | |||
406 | /** |
||
407 | * Create a button link to action. |
||
408 | * |
||
409 | * @param string $action |
||
410 | * @param string $title |
||
411 | * @param array $parameters |
||
412 | * @param array $attributes |
||
413 | * |
||
414 | * @return string |
||
415 | */ |
||
416 | public function linkAction($action, $title = null, array $parameters = array(), array $attributes = array()) |
||
420 | |||
421 | /** |
||
422 | * Create a button link to an email address. |
||
423 | * |
||
424 | * @param string $email |
||
425 | * @param string $title |
||
426 | * @param array $attributes |
||
427 | * |
||
428 | * @return string |
||
429 | */ |
||
430 | public function mailto($email, $title = null, array $attributes = array()) |
||
434 | |||
435 | /** |
||
436 | * Create a none alert item. |
||
437 | * |
||
438 | * @param string $content |
||
439 | * @param string $emphasis |
||
440 | * @param boolean $dismissible |
||
441 | * @param array $attributes |
||
442 | * |
||
443 | * @return string |
||
444 | */ |
||
445 | public function none($content = null, $emphasis = null, $dismissible = false, array $attributes = array()) |
||
449 | |||
450 | /** |
||
451 | * Create a success alert item. |
||
452 | * |
||
453 | * @param string $content |
||
454 | * @param string $emphasis |
||
455 | * @param boolean $dismissible |
||
456 | * @param array $attributes |
||
457 | * |
||
458 | * @return string |
||
459 | */ |
||
460 | public function success($content = null, $emphasis = null, $dismissible = false, array $attributes = array()) |
||
464 | |||
465 | /** |
||
466 | * Create an info alert item. |
||
467 | * |
||
468 | * @param string $content |
||
469 | * @param string $emphasis |
||
470 | * @param boolean $dismissible |
||
471 | * @param array $attributes |
||
472 | * |
||
473 | * @return string |
||
474 | */ |
||
475 | public function info($content = null, $emphasis = null, $dismissible = false, array $attributes = array()) |
||
479 | |||
480 | /** |
||
481 | * Create a warning alert item. |
||
482 | * |
||
483 | * @param string $content |
||
484 | * @param string $emphasis |
||
485 | * @param boolean $dismissible |
||
486 | * @param array $attributes |
||
487 | * |
||
488 | * @return string |
||
489 | */ |
||
490 | public function warning($content = null, $emphasis = null, $dismissible = false, array $attributes = array()) |
||
494 | |||
495 | /** |
||
496 | * Create a danger alert item. |
||
497 | * |
||
498 | * @param string $content |
||
499 | * @param string $emphasis |
||
500 | * @param boolean $dismissible |
||
501 | * @param array $attributes |
||
502 | * |
||
503 | * @return string |
||
504 | */ |
||
505 | public function danger($content = null, $emphasis = null, $dismissible = false, array $attributes = array()) |
||
509 | |||
510 | } |