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

router url addres suffix “/” How to add ??

$router = new Phalcon\Mvc\Router(false);

    //默认首页 public
    $router->setDefaultModule("public");

    //小组 后台首页
    $router->add('/admin', array(
            'module' => 'backend',
            'controller' => 'index',
            'action' => 'index'
    ));
    //前台首页
    $router->add('/index', array(
            'module' => 'public',
            'controller' => 'index',
            'action' => 'index'
    ));     

    //小组
    $router->add('/group', array(
            'module' => 'group',
            'controller' => 'index',
            'action' => 'index'
    ));

return $router;

++++++++++++++++++++++++++++++++++++ look like this : https://forum.phalcon.io/post/discussion

I want this url: https://forum.phalcon.io/post/discussion/

so /

I want to like this :

https://xxx.com/discussion” and “https://xxx.com/discussion/

The same result ,But now is not the result



13.1k

https://xxx.com/discussion” and “https://xxx.com/discussion/

I want The same result ,But now is not the result but now According to the results of the different



13.1k
Accepted
answer

oh $router->removeExtraSlashes(true); Has been solved