title: Optional parameters in url - Slim 3
body: <p>I have a pretty straightforward question. I am using Slim 3 to build a RESTfull api.</p>
  
  <p>How come this works:</p>
  
  <pre><code>$app-&gt;get('/news[/{params:.*}]', function ($request, $response, $args) {
      $params = explode('/', $request-&gt;getAttribute('params'));
      $response-&gt;write("news!");
      return $response;
  
  });
  </code></pre>
  
  <p>But not this:</p>
  
  <pre><code>$app-&gt;get('/news[/{params:.*}]/details', function ($request, $response, $args) {
  $params = explode('/', $request-&gt;getAttribute('params'));
          $response-&gt;write("news details");
          return $response;
  
  });
  </code></pre>
  
  <p>In fact the latter does not compile.</p>