Route Collision

Hi,

I have these two routes, they both are inside a group route class,

      $this->add('/login', array(
            'controller'    => 'user',
            'action'        => 'login'
        ))->setName("login");

and second one after the first one,

        $this->addGet('/{address}', array(
            'controller'    => 'user',
            'action'        => 'profile',
            'address'       => 1
        ))->setName("profile");

Normally, if a user tries to open: http://www.example.com/login, he/she should see a login page, but it redirects to profile route. Where is the problem?



5.4k

(As mentioned in the docs) routes are evaluated in reverse order.

It seems your 2nd route matches /login