forked from steampixel/simplePHPRouter
-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
The next big priority item is to accept a RegEx constraint for router parameters, via a method that can be chained onto a route method. This would look something like this:
// Single parameter
Router::get('/hello/{name}', function ($n) {
return "Hello, $n!";
})->where('name', '[A-Za-z0-9]+');
// Multi parameter
Router::get('/hello/{name}/age/{num}', function ($n, $a) {
return "Hello, $a yo named $n!";
})->where(['name' => '[A-Za-z0-9]+', 'num' => '[0-9]+']);This ensures the user can have the level of control they want, while keeping it concise and clean.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request