S
S
symnoob2019-09-24 07:01:34
Twig
symnoob, 2019-09-24 07:01:34

Is there something like include_once in TWIG?

Hello everyone, is there something like include once in twig?
Thanks in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
FanatPHP, 2019-09-24
@FanatPHP

include_once is a crutch for users who don't know what is being called where.
The existence of this feature could still be justified in the days when there was no autoload, and the application could consist of several independent third-party modules.
But right now there is no reason to use _once.
The structure of the template should be meaningful and logical. So that everything that should be shown is called exactly where it is needed, and in a single instance.

K
kafkiansky, 2019-09-28
@mad_maximus

Everything that is missing in a twig is written through extensions to it. If you have symphony, then it is in the dock if you find the section with AbstractExtension.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question