I’d like to run a Silex Application like this in Command Line:
$app = new Silex\Application();
$app->get('/hello/{name}', function($name) use($app) {
return 'Hello '.$app->escape($name);
});
$app->run();
I think for that purpose, i’d have to pass Symfony’s Request Object as first parameter to the run method, but i’ve got no idea, where to set the Url-Path to make it work. Any Ideas? Or is there a better way to do this?
Here’s a simple way to do it:
And then on the command line: