title: Getting route path arguments in middleware
body: <p>In Slim 3 I have group with the same actions which depends on <code>$args</code>:</p>
  
  <pre><code>$this-&gt;group('{id}/', function () {
      $this-&gt;get('first/', function (Request $req, Response $res, $args) {
          $myData = operations($args['id']);
          ...
      });
  
      $this-&gt;post('second/', function (Request $req, Response $res, $args) {
          $myData = operations($args['id']);
          ...
      });
  });
  </code></pre>
  
  <p>I could transfer those common operations to higher level.
  As I read it could be middleware but in middleware I cannot (or don't know how) access to <code>$args</code>.</p>
  
  <pre><code>-&gt;add(function (ServerRequestInterface $request, ResponseInterface $response, callable $next) {
      //how to get arguments?
      $request = $request-&gt;withAttribute('myData', operations($id); 
      $response = $next($request, $response);
  
      return $response;
  });
  </code></pre>