diff options
author | Andreas Gohr <andi@splitbrain.org> | 2015-08-18 20:36:08 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2015-08-18 20:38:33 +0200 |
commit | a453c16b3290eabdf35778c54498101c737544e1 (patch) | |
tree | c3638bb285b3005758df58e81e7b148ea373523e /inc/Form/InputElement.php | |
parent | 8f0df229ed3e82191f118594ea5145c9d5942d7b (diff) | |
download | rpg-a453c16b3290eabdf35778c54498101c737544e1.tar.gz rpg-a453c16b3290eabdf35778c54498101c737544e1.tar.bz2 |
Form: more flexible label handling #1312
You now can add labels that don't wrap around inputs, but you have to
ensure IDs are properly assigned yourself.
The Label class has been renamed to LabelElement to reflect the naming
scheme of the other elements.
Diffstat (limited to 'inc/Form/InputElement.php')
-rw-r--r-- | inc/Form/InputElement.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/Form/InputElement.php b/inc/Form/InputElement.php index 693eeffc5..694dd0848 100644 --- a/inc/Form/InputElement.php +++ b/inc/Form/InputElement.php @@ -12,7 +12,7 @@ namespace dokuwiki\Form; */ class InputElement extends Element { /** - * @var Label + * @var LabelElement */ protected $label = null; @@ -24,19 +24,19 @@ class InputElement extends Element { /** * @param string $type The type of this element * @param string $name The name of this form element - * @param string $label The label text for this element + * @param string $label The label text for this element (will be autoescaped) */ public function __construct($type, $name, $label = '') { parent::__construct($type, array('name' => $name)); $this->attr('name', $name); $this->attr('type', $type); - if($label) $this->label = new Label($label); + if($label) $this->label = new LabelElement($label); } /** * Returns the label element if there's one set * - * @return Label|null + * @return LabelElement|null */ public function getLabel() { return $this->label; |