title: Pass arguments to controller methods
body: <p>I'm using silex and I'm trying to use controllers as services. This conception works fine but I can't figure out how to pass arguments to controller method. Here is what I mean</p>
  
  <p>IndexController.php</p>
  
  <pre><code>class IndexController
  {
    public function pagesAction($page)
    {
      return $page;
    }
  }
  </code></pre>
  
  <p>//app.php</p>
  
  <pre><code>$app['index.controller'] = $app-&gt;share(function() use ($app) {
         return new Controllers\IndexController();
       });
   $app-&gt;get('/pages/{num}', "index.controller:pagesAction");
  </code></pre>
  
  <p>When I access pages/3 I get </p>
  
  <pre><code>Controller "SD\Controllers\IndexController::pagesAction()" requires that you provide a value for the "$page" argument (because there is no default value or because there is a non optional argument after this one).
  </code></pre>
  
  <p>I also tried </p>
  
  <pre><code>$app-&gt;get('/pages/{num}', "index.controller:pagesAction:num");
  </code></pre>
  
  <p>Any ideas?</p>