freelinking.theme.inc in Freelinking 4.0.x
Same filename and directory in other branches
Freelinking template preprocess functions.
File
freelinking.theme.incView 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
Name | Description |
---|---|
template_preprocess_freelink | Default implementation for template_preprocess_freelink(). |
template_preprocess_freelinking_error | Default implementation for template_preprocess_freelink_error(). |