Ste
Ste

Reputation: 1520

Silex route match all, also /

using this code i get No route found for "GET /" when i point to homepage

$app->match('{url}', function($url) use($app) {


})->method('GET|POST')->assert('url', '.+');

There is a regex or something to match also the / ?

Thanks

Upvotes: 1

Views: 656

Answers (1)

Raphaël Vigée
Raphaël Vigée

Reputation: 2045

I haven't tried this, but this may work :

$app->match('/{url}', function($url) use($app) {


})
->method('GET|POST')
->assert('url', '.+')
->value('url', '');

Upvotes: 5

Related Questions