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"
$router->add(
"/manual/([a-z]{2})/([a-z\.]+)\.html",
array(
"controller" => "manual",
"action" => "show",
"language" => 1,
"file" => 2
)
)->setName("theexample"); // I have only added this line
The above code is from https://docs.phalcon.io/en/latest/reference/routing.html#usage-examples
Then, when I want to generate an URL like here:
$url = $this->url->get(array(
"for" => "theexample",
"language" => "en",
"file" => "translate.adapter",
));
var_dum($url);
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?
TIA