Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Route annotation: parametros regex

Hey Guys,

I'm using annotations for my routes, but I can make them get validated using a regular expression in the following way:

<?php

/**
 [email protected]("/date/{date:([0-9]{4}-[0-9]{1,2}-[0-9]{1,2})}
 */
 public function dateAction($date){

 }

If I connect to http://xxx/date/2015-01-01, it returns a 404?

Someone can help me? Thanks in advance for your help,



6.3k
Accepted
answer

Your annotation is missing ") at the end. With that added it's working for me in Phalcon 1.3.4