Twig template cannot include php template

后端 未结 3 1399
鱼传尺愫
鱼传尺愫 2021-01-13 10:00

I encountered a problem, which for me is quite not clear and hard to understand. I have tried to make calendar widget, which is supposed to be display on every page on my si

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-13 10:25

    You cannot mix-and-match twig and php in a single Response (to do so would be circumventing part of the point of twig, which is to prevent designers from creating too much logic in the view).

    I think the Symfony documentation should/could be clearer about this (at the moment it basically says "enable them both and do what you like").

    If you embed another controller then you should be able to serve up a different Response and that Response can be php based.

提交回复
热议问题