By hari, 28 March, 2023 Linking to routes in Twig by using path($name, $parameters, $options) function are defined in close parallel to those found in RoutingExtension.php The following example will help you to understand the path function in different context use case. {# Link to frontpage view. #} <a href="{{ path('view.frontpage.page_1') }}">{{ 'View all content'|t }}</a> {# Link to user entity/profile page. #} <a href="{{ path('entity.user.canonical', {'user': user.id}) }}">{{ 'View user profile'|t }}</a> {# Link to node page. #} <a href="{{ path('entity.node.canonical', {'node': node.id}) }}">{{ 'View node page'|t }}</a> {# Add a destination query parameter. Simple Example #} <a href="{{ path('user.login', {}, {'query': {'destination': path('<current>') }}) }}">{{ 'View node page'|t }}</a>. {# Add a destination query parameter. Advanced Example, registration_form.simple_form is a custom route from a custom module with the name registration_form #} {% set redirect_path = path('registration_form.simple_form', {'node': node.id}) %} <a href="{{ path('user.register',{},{'query':{'destination': redirect_path }}) }}">{{ 'Register'|t }}</a> Tags Drupal Twig