Query parameter string in cakePHP 3.4

Sorry I’m new to cakephp… I’m setting up Url route like below,

  Router::scope('/', function ($routes) {
        $routes->connect(
            '/users/:id/:slug',
            ['controller' => 'Users', 'action' => 'view'],
            [
                'pass' => ['id', 'slug'],
                'id' => '[0-9]+'
            ]
        );
    });

Router::scope('/', function ($routes) {
    $routes->connect(
        '/users/:slug',
        ['controller' => 'Users', 'action' => 'login'],
        [
            'pass' => ['slug']
        ]
    );
});

is there any wrong with this?