You are here

function template_preprocess_interval in Interval Field 8

Returns HTML for an interval form element.

File

./interval.module, line 28
Defines an interval field. @copyright Copyright(c) 2011 Rowlands Group @license GPL v2+ http://www.fsf.org/licensing/licenses/gpl.html @author Lee Rowlands leerowlands at rowlandsgroup dot com

Code

function template_preprocess_interval(&$variables) {
  $element = $variables['element'];
  $variables['attributes'] = [];
  if (isset($element['#id'])) {
    $variables['attributes']['id'] = $element['#id'];
  }
  if (!empty($element['#attributes']['class'])) {
    $variables['attributes']['class'] = (array) $element['#attributes']['class'];
  }
  $variables['attributes']['class'][] = 'container-inline';
  $variables['children'] = \Drupal::service('renderer')
    ->render($element);
}