树枝模板上的控制器可以在另一个树枝模板中扩展吗?

I'm making a web site with Symfony and I'm having some problems. Let's say I have three templates : base.html.twig, index.html.twig and menu.html.twig.

The base template can be used for all my pages, my index template extends the base template and also my menu template.

I have a controller to render my index.html.twig with the route "/projectmanager/dashboard".

I want to have a controller for my menu template because I must display data from a database, but I don't succeed from doing it.

Do you have an idea how to do it ?

I'm new to Stackoverflow and a beginner with Symfony, I just study it. If you need more information about my code, just ask it.

Thanks for the support !

I found a solution to my problem by using an twig instruction in my index.html.twig template which is :

{{ render(controller('App\Controller\Menu\menuController')) }}

This twig instruction calls the controller of my menu.

I figure it out on a french forum where someone share me this link.