Upstatement / routes

Simple routing for WordPress
188 stars 39 forks source link

Make more (all?) AltoRouter options available #11

Open mgussekloo opened 6 years ago

mgussekloo commented 6 years ago

AltoRouter already provides optional parameters, but Timber doesn't support them because this router strips question marks. I would like to use optional parameters, and maybe it wouldn't be a bad idea to just provide access to the AltoRouter object?

Something like

Routes::getRouter()->addRoutes([ ['GET','/users/[i:id?]', function($params) { etc... })

mgussekloo commented 6 years ago

Also, line 103 ($fullPath = is_readable($template);) returns true for files that exist, but may not be inside the theme directory... Maybe I can make a pull request to improve these two points?

jasperrooduijn commented 6 years ago

I was also searching for optinal parameters for my route. It would be really great i we could get this to work...Have you found any solution yet?