Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
- $formats = explode(':', $this->getSetting('format'));
- $element += [
- '#type' => 'fieldset',
- '#attributes' => array('class' => ['container-inline', 'hms-field']),
- ];
- foreach ($formats as $format) {
- $element[$format] = [
- '#default_value' => isset($items[$delta]->value) ? $items[$delta]->value : NULL,
- '#format' => $format,
- '#type' => 'hms',
- ];
- }
- return array('value' => $element);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement