title: Phalcon routing, how to set default parameters?
body: <p>I'm trying to create dynamic routes in Phalcon <code>1.3.4</code>, but if a parameter is missing (like <code>:action</code> or <code>:params</code>) the route doesn't match.</p>
  
  <p>Here is the (working) code :</p>
  
  <pre><code>$router = new Phalcon\Mvc\Router(TRUE);
  $group = new Phalcon\Mvc\Router\Group([
                                             'namespace' =&gt; 'App\\Backoffice',
                                             'controller' =&gt; 'Index',
                                         ]);
  
  // All the routes start with /group
  $group-&gt;setPrefix('/backoffice');
  
  // Adding route to group
  $group-&gt;add('', ['action' =&gt; 'index']); // matches /backoffice
  $group-&gt;add('/:controller', ['controller' =&gt; 1]); // matches /backoffice/moderate
  $group-&gt;add('/:controller/:action', ['controller' =&gt; 1, 'action' =&gt; 2]);
  $group-&gt;add('/:controller/:action/:params', ['controller' =&gt; 1, 'action' =&gt; 2, 'params' =&gt; 3]);
  
  $router-&gt;mount($group);
  </code></pre>
  
  <p>Is it possible to remove the redundant first three routes and only keep the fourth ? By assigning default values to match <code>/backoffice</code> or <code>/backoffice/moderate</code>.  </p>