As cookbook says:
Routes can use the _host option to only match specific hosts. You can use the *. wildcard to match any subdomain.
But what if I would like set same route for multiple hosts at once?
For example:
$routes->connect(
'/images',
['controller' => 'Images', 'action' => 'index']
)->setHost('images.example.com');
$routes->connect(
'/images',
['controller' => 'Images', 'action' => 'index']
)->setHost('images.example2.com');
$routes->connect(
'/images',
['controller' => 'Images', 'action' => 'index']
)->setHost('images.example3.com');
Above is pointless if I have to set several dozen of those routes.
Ideal would be something like this:
$routes->connect(
'/images',
['controller' => 'Images', 'action' => 'index']
)->setHosts(['images.example.com','images.example2.com','images.example3.com']);