I have this route set up, which works OK, but I’d like to know if it’s possible to make a route that captures /
s in a parameter
Right now I have
return static function (Application $app): void {
//...
$app->get(
sprintf(
'/img/store/:%s/:%s/:%s[/:%s]',
App\Handler\ImgStoreHandler::PART_1_ATTRIBUTE,
App\Handler\ImgStoreHandler::PART_2_ATTRIBUTE,
App\Handler\ImgStoreHandler::PART_3_ATTRIBUTE,
App\Handler\ImgStoreHandler::MANIPULATIONS_ATTRIBUTE
),
[
ProblemDetailsMiddleware::class,
App\Handler\ImgStoreHandler::class,
],
'img'
);
But ideally, I’d like something like
$app->get(
sprintf(
'/img/store/:%s',
App\Handler\ImgStoreHandler::PATH_ATTRIBUTE,
),
[
ProblemDetailsMiddleware::class,
App\Handler\ImgStoreHandler::class,
],
'img'
);
where I can set regex to match with the parameter.
Is this possible with laminas-router?