We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

a question of mvc route and url

i define a route with name "item-view" : $_router->add("/item/([0-9]+)\\.html", ['controller' => 'item', 'action' => 'view', 'id' => 1])->setName('item-view');

when use url component 's get() method to create url : echo ($_di->get('url')->get(['for' => 'item-view', 'id' => '10000'])); but the result is /item/10000\.html , not is /item/10000.html

extra backslashes, why?

Hi!

Use

 $_router->add("/item/([0-9]+)\.html", ['controller' => 'item', 'action' => 'view', 'id' => 1])->setName('item-view');