You are here

freelinking.theme.inc in Freelinking 4.0.x

Same filename and directory in other branches
  1. 8.3 freelinking.theme.inc

Freelinking template preprocess functions.

File

freelinking.theme.inc
View source
<?php

/**
 * @file
 * Freelinking template preprocess functions.
 */
use Drupal\Core\Template\Attribute;

/**
 * Default implementation for template_preprocess_freelink().
 *
 * @param array &$variables
 *   The render element properties containing:
 *   -
 */
function template_preprocess_freelink(array &$variables) {
  if (!isset($variables['attributes'])) {
    $variables['attributes'] = [];
  }
  $variables['attributes'] = new Attribute($variables['attributes']);
}

/**
 * Default implementation for template_preprocess_freelink_error().
 *
 * @param array &$variables
 *   The render element properties containing:
 *   -
 */
function template_preprocess_freelinking_error(array &$variables) {
  $variables['attributes']['classes'] += [
    'freelink-error',
    'freelink-error--' . $variables['plugin'],
  ];
  $variables['attributes'] = new Attribute($variables['attributes']);
}

Functions

Namesort descending Description
template_preprocess_freelink Default implementation for template_preprocess_freelink().
template_preprocess_freelinking_error Default implementation for template_preprocess_freelink_error().