
| Current Path : /var/www/html/wirtschaftsclub.web-klick.de/themes/bootstrap/src/Plugin/Preprocess/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/wirtschaftsclub.web-klick.de/themes/bootstrap/src/Plugin/Preprocess/Input.php |
<?php
namespace Drupal\bootstrap\Plugin\Preprocess;
use Drupal\bootstrap\Utility\Element;
use Drupal\bootstrap\Utility\Variables;
/**
* Pre-processes variables for the "input" theme hook.
*
* @ingroup plugins_preprocess
*
* @BootstrapPreprocess("input")
*/
class Input extends PreprocessBase implements PreprocessInterface {
/**
* {@inheritdoc}
*/
public function preprocessElement(Element $element, Variables $variables) {
// Autocomplete.
if ($route = $element->getProperty('autocomplete_route_name')) {
$variables['autocomplete'] = TRUE;
}
// Create variables for #input_group and #input_group_button flags.
$variables['input_group'] = $element->getProperty('input_group') || $element->getProperty('input_group_button');
// Map the element properties.
$variables->map([
'attributes' => 'attributes',
'icon' => 'icon',
'field_prefix' => 'prefix',
'field_suffix' => 'suffix',
'type' => 'type',
]);
// Ensure attributes are proper objects.
$this->preprocessAttributes();
}
}