如何添加自定义配置,例如host_name=“”;www.abc.com”;在符号2中


how to add custom configuration e.g. host_name = "www.abc.com" in symfony2?

如何在symfony2中添加自定义配置,例如host_name="www.abc.com"?我知道我们可以使用请求对象访问主机名,但我希望主机名在symfony CLI自定义命令中。

http://symfony.com/doc/current/cookbook/console/sending_emails.html

parameters:
    router.request_context.host: example.org
    router.request_context.scheme: https
    router.request_context.base_url: my/path
$context = $this->getContainer()->get('router')->getContext();

工作。