Symfony Method to Turn Template to String

天涯浪子 提交于 2019-12-08 12:02:03

问题


I use the Symfony PHP MVC framework. I'm using JSON to pass an AJAX response, and I need an action's template HTML to be one of the values passed. Does Symfony have a method along the lines of renderTemplateToString() ?

Even for those unfamiliar with Symfony, is there an obvious way to do this?


回答1:


Use sfAction::getPartial() and getComponent().



来源:https://stackoverflow.com/questions/1926041/symfony-method-to-turn-template-to-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!