I want current match url in action. See below
‘routes’ => [
[
'pattern' => '(:all)',
'action' => function () {
// do something here
// when the URL matches the pattern above
$page = page->find('custom_url', 'I want to pass current match url here');
return page('/products/fd');
}
Note that you should be careful with $site->index() (can affect performance in large sites), so if you can limit where Kirby should look for the requested page, then do.