/** * {@inheritdoc} */ public function preprocessElement(Variables $variables, $hook, array $info) { // Create variables for #input_group and #input_group_button flags. $variables['input_group'] = $variables->element->getProperty('input_group') || $variables->element->getProperty('input_group_button'); // Map the element properties. $variables->map(['attributes' => 'attributes', 'field_prefix' => 'prefix', 'field_suffix' => 'suffix']); // Ensure attributes are proper objects. $this->preprocessAttributes($variables, $hook, $info); }
/** * {@inheritdoc} */ public function preprocessElement(Variables $variables, $hook, array $info) { $variables->element->colorize(); $variables->element->setButtonSize(); $variables->element->setIcon($variables->element->getProperty('icon')); $variables['icon_only'] = $variables->element->getProperty('icon_only'); $variables['label'] = $variables->element->getProperty('value'); if ($variables->element->getProperty('split')) { $variables->map([$variables::SPLIT_BUTTON]); } parent::preprocessElement($variables, $hook, $info); }
/** * {@inheritdoc} */ public function preprocessElement(Variables $variables, $hook, array $info) { $variables->element->map(['id', 'name', 'value', 'type']); // Autocomplete. if ($route = $variables->element->getProperty('autocomplete_route_name')) { $variables['autocomplete'] = TRUE; } // Create variables for #input_group and #input_group_button flags. $variables['input_group'] = $variables->element->getProperty('input_group') || $variables->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($variables, $hook, $info); }
/** * {@inheritdoc} */ public function preprocessElement(Variables $variables, $hook, array $info) { $variables->map(['attributes']); $this->preprocessAttributes($variables, $hook, $info); }