I want to be able to run a controller's method from URL, and from the console. How can I do that? I mean, having a method in some controller:
/**
* @Route("/fooBar", name="fooBar")
*/
public function actionFooBar() {
$this -> get('file') -> saveSomethingToSomeFile();
return 'a';
}
I want to be able to open it via http://domain.com/fooBar
and php app/console fooBar
, or something like this.
The console one doesn't work. How can I solve this?