public function setHTMLByView($view, array $parameters = array())
    {
        if (!$this->container) {
            throw new MissingTemplatingEngineException("To use this function, a Container object must be passed to the constructor (@service_container service)");
        }
        /** @var EngineInterface $engine */
        $engine = $this->container->get('templating');
        $this->setHTML($engine->render($view, $parameters));
    }
public function setHTMLByView($view, array $parameters = array())
    {
        if (!$this->container) {
            throw new MissingTemplatingEngineException("To use this function, a Container object must be passed to the constructor (@service_container service)");
        }
        /** @var EngineInterface $engine */
        $engine = $this->container->get('templating');
        $this->setHTML($engine->render($view, $parameters));
    }
public function setHTMLByView ( $ view , array $ parameters = array ( ) ) { if ( ! $ this -> container ) { throw new MissingTemplatingEngineException ( "To use this function, a Container object must be passed to the constructor (@service_container service)" ) ; } /** @var EngineInterface $engine */ $ engine = $ this -> container -> get ( 'templating' ) ; $ this -> setHTML ( $ engine -> render ( $ view , $ parameters ) ) ; }
Set the string which represents the HTML file to be sent as email by rendering a template.

@param string $view is the view to be rendered, e.g. Acme:MyBundle:MyController:index.html.twig
@param array[optional] $parameters the array of options to be used for template rendering. This field is optional
@throws MissingTemplatingEngineException The TwigEngine must be passed to the constructor, otherwise an exception is thrown
Set the string which represents the HTML file to be sent as email by rendering a template .