Hi,
I have a problem with parameters in \Phalcon\Mvc\Router\Annotations
. I want change my long routing file to annotations mechanism which is awesome.
Before I have something like this:
$router->add('/example/all/(\d{4})/(\d{2})([/]?)', array(
'controller' => 'example',
'action' => 'index',
'year' => 1,
'month' => 2
))->setName('example-name');
I change this rule to annotation in indexAction
of ExampleController
:
/**
* @Route("/all/(year:\d{4})/(month:\d{2})", name="example-name")
*/
public function indexAction($year = null, $month = null)
{
if (is_null($year) || is_null($month)) {
$year = date('Y');
$month = date('m');
}
...
$this->view->year = $year;
$this->view->month = $month;
}
In view I use named route:
{{ url(['for': 'example-name', 'year': year, 'month': month]) }}
Before I got this url: https://mydomain.com/example/all/2014/07/
After change to annotations I got: https://mydomain.com/example/all//
@Phalcon is it a bug or am I doing something wrong?
//cc @Baryshev @Dreamsxin