hello everyone, i am having some problems with my routes. i have the following route
members/(:any)
to show virtual pages of members. everything works fine. problem is, the members page itself has some files, for instance a .csv file. this means the file URL is
members/mycsv.csv
is there a way i can bypass files in the route? otherwise i am getting an error in the route, since in the action i only return the virtual pages, so maybe something like this?
'action' => function ($nameslug) {
if (!str_contains($nameslug, '.csv')) { // this is of course not nice, since i only check csv
$vPage = prepUserPage($nameslug); // i create the virtual page somewhere else
return $vPage;
} else {
// what do i do here?
}
}
also, would this be the best place to do it? or should i do it in a route:before hook?
thank you in advance!