I have a custom module in which I am setting a front end route that routes through to a controller. Like so:
Event::on(
UrlManager::class,
UrlManager::EVENT_REGISTER_SITE_URL_RULES,
function (RegisterUrlRulesEvent $event) {
$event->rules['my-account/orders/<order>/pause'] = 'custom-module-name/order/pause-order';
}
);
This works fine but how can I access that <order>
named parameter within my controller? Is the only way to use craft::$app->request->getSegment(3);
?
my-account/orders/<order>?action=pause
and access thepause
via$param = Craft::$app->getRequest()->getParam('action');
Might be an easier solution.