title: How to check the url in the controller slim-framework
body: <p>I have problem with <code>slim</code></p>
  
  <p>I have the controllar, and 2 routs send to this controller.</p>
  
  <ol>
  <li>The page html with teig. </li>
  <li>The api and show that in json.</li>
  </ol>
  
  <p>Now I need to check, if I request with this url:
  <code>/product/{slug}</code></p>
  
  <p>return the twig (I do the return).</p>
  
  <p>and if I request to url:<code>api/product/{slug}</code>
  return me the json (i do the return).</p>
  
  <p>now I don't know how to the the if request.
  and how I just to know check what url request that controller.</p>