CakePHP 3.x: Adding parameter in route

I am trying to use routes.php to connect one route to another. The route I would like to connect is ‘/layouts/editspecial/:id’ I would like this route to go to my Layouts controller edit action, with arguments of id and true, in that order. The id is easy, but I’m unsure how to make the route pass true by default.

Thank you.

You can pass additional params in the route itself like this

$routes->connect('/example/:id', [
    'controller' => 'Pages',
    'action' => 'display',
    true //pass any additional param here
], [
    'id' => '[0-9]+',
    'routeClass' => DashedRoute::class

When you use you’ll get