i'm trying to assign $this->render()
result to a method (this method renders google map's infoWindow/baloon).
I'm using method like this to create this infoWindow:
$infoWindow->setContent(<here goes the template>);
but passing it like this:
$infoWindow->setContent($this->render('WmapFrontBundle:Place:infoWindow.html.twig'));
don't work at all. What's the proper way to assign template to a variable or pass it's content to a method ?
Use renderView()
, it returns the rendered template only.
render()
returns a Response
object (with the rendered template, headers, etc).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With