Routing in cakephp 3.4


hello guys i have a serious challenge here any any help would definately save my job. I encourage my boss to migrate to cake 3.4 from 2.X version. after a long discussion, he agreed. And I start working on it… All went well with the migration until routing stage. In version 2.4, to improve our SEO, we uses something like this in the routes.php
array(‘controller’ => ‘schools’, ‘action’ => ‘show’),
‘pass’ => array(‘school_name’)
at the end we had this pattern
and all went well. To achieve the same this in cakephp 3,4 is a huge challenge to me. Now all links we have built over time with the above code in search engine takes users to error 404
how can i achieve the same pattern in cakephp 3


this is my view.ctp <?php echo $this->Html->link($school->name,


   'controller' => 'schools',

   'action' => 'show', $school->id,

   'school_name' => strtolower(preg_replace('/\s+/', '_', $school->'name)),

   'ext' => 'school'





I have no specific answer to your problem but, this is how the routing works in 3.x

* …and connect the rest of ‘Pages’ controller’s URLs.
’, [‘controller’ => ‘Pages’, ‘action’ => ‘display’]);

 * Connect catchall routes for all controllers.
 * Using the argument `DashedRoute`, the `fallbacks` method is a shortcut for
 *    `$routes->connect('/:controller', ['action' => 'index'], ['routeClass' => 'DashedRoute']);`
 *    `$routes->connect('/:controller/:action/*', [], ['routeClass' => 'DashedRoute']);`
 * Any route class can be used with this method, such as:
 * - DashedRoute
 * - InflectedRoute
 * - Route
 * - Or your own route class
 * You can remove these routes once you've connected the
 * routes you want in your application.

for more detail: