Lines Matching +full:- +full:- +full:name
28 * @param string $name The name of this form element
31 public function __construct($type, $name, $label = '') argument
33 parent::__construct($type, ['name' => $name]);
34 $this->attr('name', $name);
35 $this->attr('type', $type);
36 if ($label) $this->label = new LabelElement($label);
46 return $this->label;
60 $this->useInput = (bool) $useinput;
72 if ($this->label) $this->label->attr('for', $id);
86 if ($this->label) $this->label->addClass($class);
93 * The element's name could have been given as a simple string ('foo')
100 * @return array name and array key (null if not an array)
104 $name = $this->attr('name');
105 parse_str("$name=1", $parsed);
107 $name = array_keys($parsed);
108 $name = array_shift($name);
110 if (isset($parsed[$name]) && is_array($parsed[$name])) {
111 $key = array_keys($parsed[$name]);
117 return [$name, $key];
127 [$name, $key] = $this->getInputName();
128 if (!$INPUT->has($name)) return;
131 $value = $INPUT->str($name);
133 $value = $INPUT->arr($name);
140 $this->val($value);
150 if ($this->useInput) $this->prefillInput();
151 return '<input ' . buildAttributes($this->attrs()) . ' />';
161 if ($this->label) {
162 return '<label ' . buildAttributes($this->label->attrs()) . '>' . DOKU_LF
163 . '<span>' . hsc($this->label->val()) . '</span>' . DOKU_LF
164 . $this->mainElementHTML() . DOKU_LF
167 return $this->mainElementHTML();