Symfony Twig – multiple dynamic extend of template

  dynamic, extends, symfony, templates, twig

I have app based on Symfony4, with dynamic plugins stored in db.
Each plugin have own template which could extend base template of app and replace/add some blocks.

I can have active more than 1 plugin.

What i am trying to do:

loop through plugins and dynamically extend base template or template of previous plugin.

For example, result should be dynamically generated:

Dashboard.html.twig extends Base.html.twig
Plugin1_dashboard.html.twig extends Dashboard.html.twig
Plugin2_dashobard.html.twig extends Plugin1_dashboard.html.twig

Any suggestions how to do this?

Is there a way to some partial render to keep value of previous extend in variable?

I don’t want to hardcode plugin includes to base template.

Source: Symfony Questions