/** * Returns the elements's label attributes as a string * * @return string */ public function getLabelAttributes() { $result = []; $label = $this->element->getLabel(); foreach ($label->getAttributes() as $attribute => $value) { if (null === $value) { $result[] = $attribute; continue; } $result[] = "{$attribute}=\"{$value}\""; } return implode(' ', $result); }
/** * Set options for ChoiceAwareElementInterface input types like Select * * @param InputInterface $input * @param $data */ protected static function addOptions(InputInterface $input, $data) { if (!$input instanceof ChoiceAwareElementInterface || !isset($data['options'])) { return; } $input->setOptions($data['options']); }