generating URL from a named route

I am working with an example from Phalcon docs but have some problems.

The URL component should build /manual/en/translate.adapter.html but instead the following URL is being build: /manual/en/translate.adapter\.html (slash before .html).

My router is a copy from the docs:

// matches "/manual/en/translate.adapter.html"
        "controller" => "manual",
        "action"     => "show",
        "language"   => 1,
        "file"       => 2
)->setName("theexample"); // I have only added this line

The above code is from

Then, when I want to generate an URL like here:

$url = $this->url->get(array(
  "for" => "theexample",
  "language" => "en",
  "file" => "translate.adapter",


I receive this:

string '/manual/en/translate.adapter\.html' (length=34)

The same problem is with $this->response->redirect().

What is wrong? I have copied the example from the docs and only named a route. How to fix this slash before a dot?



There's no way to "fix" the slash before the dot, Phalcon\Router uses regular expressions to add flexibility to routes, without the slash the dot is not escaped and preg_match will handle it as a wildcard for any characters.


Thanks for your reply!

The problem is that generated route doesn't match the base route, so it cannot be used to produce valid URLs or redirections.

Do you know how to workaroud it in some pretty way?