core icon indicating copy to clipboard operation
core copied to clipboard

multiple words route

Open oscarlosan opened this issue 2 years ago • 1 comments

hello, How can I allow multiple words in a route?

//domain.com/detroit //domain.com/new-york $city='detroit|miami|new-york|boston'; F::route('/('.$city.')', function(){ ... });

oscarlosan avatar Jul 27 '22 07:07 oscarlosan

How about do this:

F::route(
'GET /@city:[a-z-]{3,30}',
function($city) {
echo $city;
}
);

kuopassa avatar Jul 31 '22 16:07 kuopassa