Answer the question
In order to leave comments, you need to log in
symfony2. How to make a list of something from the database displayed on all pages?
Hello dear experts!
Please help me solve the problem, I need to display the category block on all pages. There are 18 pages in total, and 18 routes for them. How to do this without passing a selection with categories in each controller and action?
Answer the question
In order to leave comments, you need to log in
The most obvious is to call the controller that displays the category block in the base layout, from which all other views are inherited.
{% block categories %}
<h2>Категории</h2>
{{ render(controller('YourBundle:YourCategoryController:index')) }}
{% endblock %}
You can use the block from sonata-project.org/bundles/block/master/doc/refere...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question