How to retrieve GET parameter in Twig template I'm attempting to retrieve a GET request variable for use in a twig template.
For instance if you go to the page myurl.com/node/64?name=Dave I want the page to render

&lt;h1&gt;Dave&lt;/h1&gt;


However I'm having trouble retrieving this variable. I've attempted

&lt;h1&gt;{{app.request.get('name')}}&lt;/h1&gt;


In my twig template but it turns up empty.
How would I retrieve a GET variable from within a twig template?
You didn't say what template this is for, but app is not defined in any of the templates I have seen. 

What you could do, is add a theme_preprocess_TEMPLATE function to include the GET params. Here is a page template example:

In your mytheme.theme file, add a hook_preprocess_page function.

/**
 * Implements hook_preprocess_page()
 */
function MYTHEME_preprocess_page(&amp;$vars) {
  $vars['get']['name'] = $_GET['name'];
}


Then in your page.html.twig you can render it like this:

&lt;h1&gt;{{ get.name }}&lt;/h1&gt;