steampixel / simplePHPRouter

This is a simple and small single class PHP router that can handel the whole url routing for your project.
MIT License
406 stars 117 forks source link

URI with symbols #70

Open mfoland90 opened 1 year ago

mfoland90 commented 1 year ago

I am making a Request Feedback system, and I have a uri like this: https://requests.steadfastinnovations.com/dev/idea/get-requesttrak-up!

It's acting as that isn't found. I haven't messed with Regex. How would I allow a symbol like an exclamation point in the uri?

mfoland90 commented 1 year ago

Never mind, I've had to add the regex code. Route::add('/idea/([a-zA-Z0-9-!?]*)', function($slug) { require ROOTDIR . '/views/topic.php'; }, ['get','post']);