且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用 Symfony2 加载控制器功能并将其呈现在树枝标签中?

更新时间:2023-11-19 18:54:16

如果你有动态数据,你可以使用 ajax,但据我从你的简要信息中看到,你总是可以直接从你的视图中执行该控制器函数:

You can use ajax if you have dynamic data, but as far as I can see from your brief info, you can always execute that controller function directly from your view:

{% render "MyMyBundle:User:generateCode" with { 'url': 'your url here' } %}

有关此的更多信息,请访问:http://symfony.com/doc/2.0/quick_tour/the_view.html, 在嵌入其他控制器下

More Information on this available at: http://symfony.com/doc/2.0/quick_tour/the_view.html, under Embedding other Controllers