title: route group slim framework
body: <p>I want to create a ¨dynamic¨ route group in Slim framework but I´m getting</p>
  
  <p><strong>Warning: Missing argument 1 for {closure}() i</strong></p>
  
  <p>this is my code:</p>
  
  <pre><code>\Slim\Slim::registerAutoloader();
  
  $app = new \Slim\Slim();
  
  $app-&gt;group('/:segment1/:segment2', function ($segment1, $segment2) use ($app) {
  
      $app-&gt;map('/', function () use ($app) {
  
      })-&gt;via('GET', 'POST');
  
      $app-&gt;map('/:id', function ($id) use ($app) {
  
      })-&gt;via('GET', 'PUT', 'DELETE');
  
  });
  
  $app-&gt;run();
  </code></pre>
  
  <p>If i change:</p>
  
  <pre><code>$app-&gt;group('/:segment1/:segment2', function ($segment1, $segment2) use ($app)
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>$app-&gt;group('/segment1/segment2', function () use ($app)
  </code></pre>
  
  <p>it starts working but I need those segments to be dynamic. how can I do that?</p>