2011-09-07 112 views
4

我试图将$this->render()结果赋值给一个方法(此方法呈现Google地图的infoWindow/baloon)。将模板渲染结果传递给另一个方法

我使用的方法,这样创建这个信息窗口:

$infoWindow->setContent(<here goes the template>); 

,但通过这样的:

$infoWindow->setContent($this->render('WmapFrontBundle:Place:infoWindow.html.twig')); 

不会在所有的工作。将模板分配给变量或将其内容传递给方法的正确方法是什么?

回答

相关问题