With “webspace”, “cpu” and so on as optional parameters. They can be set but must not. For migrating a ZF1 application to Zend\Expressive the route structure should not be changed.
This really depends on the router implementation. I’m looking at https://github.com/nikic/FastRoute and it should be possible to have a
regex that matches everything after a certain point in the URI.
It creates a segment route type. There is no support yet for regex routes. There is an open issue for regex support or use another router like FastRoute. However, with FastRoute I think an optional parameter can only be followed by other optional parameters in a specific order.
So a regex could match
/order/index/index
/order/index/index/webspace/770
/order/index/index/webspace/770/cpu/4
/order/index/index/webspace/770/cpu/4/ram/32
/order/index/index/webspace/770/cpu/4/ram/32/hdd/250
But you can’t have a regex for:
/order/index/index/webspace/770
/order/index/index/cpu/4/ram/32/hdd/250
/order/index/index/cpu/4/hdd/250
It’s a while since I tried this so I’m not 100% sure.