SHARE
TWEET

Untitled

a guest Jun 18th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function my_theme_preprocess_node(&$variables){
  2.   $variables['route_name'] = $route_name;
  3.   $variables['route_parameters'] = $route_parameters;
  4. }
  5.      
  6. { <a href="{{ path('$route_name', {'node': $route_parameters}) }}">Link to the object with $route_name and $route_parameters</a> }
  7.      
  8. function my_theme_preprocess_node(&$variables){
  9.   $variables['path'] = Drupal::urlGenerator()->generateFromRoute($route_name, $route_parameters);
  10. }
  11.      
  12. <a href="{{ path }}">Link to the object with $route_name and $route_parameters</a>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top