my question is quite simple, but I could not find an answer on google.
In my silex project I have a parameter that can be or not on my url, e.g.:
domain.com/?foo=1
When I use the method before it works fine:
$app->before(function (Request $request) use ($app) {
echo $app['request']->get('foo');
});
however if I have any variant of that url I can't catch it anymore. e.g.:
domain.com/contact?foo=1
domain.com/about?foo=1
domain.com/company?foo=1
...
I know, I could create a route for that.. But if I have 20, 30 different routers, it sounds insane for me change all of them.
Any help would be really appreciated. Cheers.