title: How to get the current page name in Silex
body: <p>I'm wondering how to get the current page name, basically 'just' the last parameter in the route (i.e. /news or /about). I'm doing this because I want to be able to have the current page in the navigation highlighted.</p>
  
  <p>Ideally, I'd like to store the current page name in a global variable so that in Twig I can just compare the current page name against the link and add a class accordingly.</p>
  
  <p>I can't figure out how to add the current page name to a global variable though. I've tried using something like this:</p>
  
  <pre><code>$app['twig']-&gt;addGlobal('current_page_name', $app['request']-&gt;getRequestUri());
  </code></pre>
  
  <p>at the top of my app.php file, but an 'outside of request scope' error. But I wouldn't like to have to include this in every route.</p>
  
  <p>What's the best way to do this?</p>