template_preprocess_menu_local_action(&$variables)
Prepares variables for single local action link templates.
Default template: menu-local-action.html.twig.
array $variables: An associative array containing:
function template_preprocess_menu_local_action(&$variables) { $link = $variables['element']['#link']; $link += array( 'localized_options' => array(), ); $link['localized_options']['attributes']['class'][] = 'button'; $link['localized_options']['attributes']['class'][] = 'button-action'; $link['localized_options']['set_active_class'] = TRUE; $variables['link'] = array( '#type' => 'link', '#title' => $link['title'], '#options' => $link['localized_options'], '#url' => $link['url'], ); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!menu.inc/function/template_preprocess_menu_local_action/8.1.x