Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement