How can I pass a URL in a Silex-app?
My given specification is:
http://mysilex.app/http://anotherurl.com
So, I would like to use it in my app like this:
$app->get('/{url}', function ($url) {
//do awesome things with $url(=http://anotherurl.com)
return $url;
});
Is that possible in Silex?
Set .*
pattern for url
parameter
$app->get('/{url}', function ($url) {
//do awesome things with $url(=http://anotherurl.com)
return $url;
})
->assert('url', '.*');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.