Closed diogenesjup closed 1 year ago
In addition to letters and numbers, "example-page-3" also contains hyphens. The \w metacharacter doesn't include hyphens, only letters, numbers and underscores. To fix it, you can create a character class that includes hyphen characters, e.g.
{slug:[\w-]+}
Tks! Works fine with {slug:[\w-]+}/
I'm trying to create a route using letters+numbers, but without success.
For example, the following route
$router->add('institucional/{slug:\w+}/', ['controller' => 'Institucional', 'action' => 'pagina']);
and then in my browser
/institutional/page
Works well.
But if I do:
/institutional/example-page-3 (letters+numbers)
does not work,
and the same goes for
/institutional/hiffens-example-page
It only works if I remove the dashes
How can I resolve this?