title: Adding PHP logic withing .twig file
body: <p>I am not very familiar with TWIG templates and I need to add a bit of logic to a template file based on the URL. I know how to do it in PHP, but am sort of lost here.</p>
  
  <p>I can get the full URL using {{ app.request.uri }} but what I am really trying to do is something like this:</p>
  
  <pre><code>$uri = $_SERVER['REQUEST_URI'];
  
  if ($uri == "/page1" ||strpos($uri, "/page1/")  !== false) {
         echo " id="item1";
  }
  </code></pre>
  
  <p>Is something like this possible? Thanks</p>