Reference a static template in symfony2

后端 未结 1 1211
耶瑟儿~
耶瑟儿~ 2021-01-15 01:59

I want to use angular with symfony2. To do so it should be possible to load a template from a reference like this:

相关标签:
1条回答
  • 2021-01-15 02:25

    Simple make a template without twig tags, and a route for it to load via ajax. No controller is required

    my_template:
        path: /path/to/template
        defaults:
            _controller: FrameworkBundle:Template:template
            template: 'AcmeBundle:Angular:template.html.twig'
    

    More infos: http://symfony.com/doc/current/cookbook/templating/render_without_controller.html

    0 讨论(0)
提交回复
热议问题