getParameters(); $action = $params['action']; $container = $this->container; switch($action) { case 'Mailhandler': $x = $container->createInstance('App\Presenters\Cli\MailhandlerPresenter'); $container->callInjects($x); $res = $x->run($request); break; case 'Sendmailing': $x = $container->createInstance('App\Presenters\Cli\SendmailingPresenter'); $container->callInjects($x); $res = $x->run($request); break; case 'Test': $x = $container->createInstance('App\Presenters\TestPresenter'); $container->callInjects($x); $res = $x->run($request); break; default: $res = "Unknown action '$action'. Known are Mailhandler and Sendmailing\n"; break; } return new Nette\Application\Responses\TextResponse($res); } }