G
G
grabbee2017-01-25 15:19:43
symfony
grabbee, 2017-01-25 15:19:43

How to reference nested blocks in Twig Symfony?

I found that when using FosRestBundle when rendering a page, you don’t need to specify where the template is located at all, if you put it in the correct directory structure and file name. But, when you need to attach another one in the template, which is in the same folder, how to refer to it?
* if just a file name, it refers to the root app/Resources/views
* if in a bundle folder, then you need SomeBunle::file.html.twig
Is there really nothing to shorten the SomeBunle::file.html.twig entry?
Like self::file.html.twig ....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri, 2017-01-25
@riky

you need to write the full path.

D
Denis, 2017-01-25
@prototype_denis

'@Some/file.html.twig'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question