Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 31 lines (27 sloc) 0.739 kb
4a5d9b0 @Hayden Moved Sapphire module to open source path
Hayden authored
1 <?php
b1d2e39 @sminnee API Documentation updates
sminnee authored
2 /**
55e0a71 @chillu MINOR Documentation
chillu authored
3 * Simple label tag. This can be used to add extra text in your forms.
4 * Consider using a {@link ReadonlyField} if you need to display a label
5 * AND a value.
6 *
b1d2e39 @sminnee API Documentation updates
sminnee authored
7 * @package forms
8 * @subpackage fields-dataless
4a5d9b0 @Hayden Moved Sapphire module to open source path
Hayden authored
9 */
10 class LabelField extends DatalessField {
11
12 /**
e95c565 @chillu API CHANGE Changed constructor parameters for LabelField and Header: Fir...
chillu authored
13 * @param string $name
14 * @param string $title
15 * @param Form $form
4a5d9b0 @Hayden Moved Sapphire module to open source path
Hayden authored
16 */
e2f073f @chillu Method visibility according to coding conventions
chillu authored
17 public function __construct($name, $title) {
e95c565 @chillu API CHANGE Changed constructor parameters for LabelField and Header: Fir...
chillu authored
18 // legacy handling for old parameters: $title, $heading, ...
19 // instead of new handling: $name, $title, $heading, ...
20 $args = func_get_args();
21 if(!isset($args[1])) {
22 $title = (isset($args[0])) ? $args[0] : null;
23 $name = $title;
24 $form = (isset($args[3])) ? $args[3] : null;
25 }
26
cc32957 @chillu API CHANGE Don't allow specifying $form as constructor argument in vario...
chillu authored
27 parent::__construct($name, $title);
4a5d9b0 @Hayden Moved Sapphire module to open source path
Hayden authored
28 }
9e548f5 @halkyon API CHANGE FormField::Field() and FormField::FieldHolder() now render in...
halkyon authored
29
f8082e4 @simonwelsh MINOR Add newline to end of files without one
simonwelsh authored
30 }
Something went wrong with that request. Please try again.