Sets a callback that is called if the route is matched.
The developer can implement any arbitrary conditions here
If the callback returns false the route is treated as not matched

<?php$router->add("/login",["module"=>"admin","controller"=>"session",])->beforeMatch(function($uri,$route){// Check if the request was made with Ajaxif($_SERVER["HTTP_X_REQUESTED_WITH"]==="xmlhttprequest"){returnfalse;}returntrue;});