B
B
BonBon Slick2018-10-16 19:19:17
symfony
BonBon Slick, 2018-10-16 19:19:17

How to share a form across all twig templates?

There is a form to leave a review about the site, this form pops up in the pop-up throughout the site. It is necessary to create a form and share it with all the layouts from which all other templates go.
How is this done in Symfony?
I know that in Laravel there is such a thing, I did it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim, 2018-10-16
@BonBonSlick

If it's just an html form. That is described in a separate file and inserted using include.
If this is a symfony form, then make your own Twig Extension https://symfony.com/doc/current/templating/twig_ex... in which the function will return this form in this separate file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question