Answer the question
In order to leave comments, you need to log in
How to add variable to base layout in Symfony2?
Good day!
The Symfony documentation is only in English, I'm studying the second day and my head hurts honestly. But not about that now...
There is a block of code, let's call it a menu, which is the same on all pages, how to place it correctly in base.html.twig if the data is taken from the database and how to set up getting this data in one place?
Roughly speaking, I would like to write in the template like this:
<?php $items = $menu->getItems(); ?>
Before that, I dealt with Yii2, everything is much simpler in this regard.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question