8000 Extend template in child bundle fires a nested loop error · Issue #15755 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Extend template in child bundle fires a nested loop error #15755
Closed
@bertoost

Description

@bertoost

For example; when you have a "A\MyBundle" namespace and a "B\MyBundle". The B version is only loaded in certain situation and is a child bundle of "A\MyBundle". In this bundle there is a controller and a view etc.
The view's filename is "index.html.twig" and you want to override some blocks in the B version.
You can not create the same file and extend the A one. Like:

{# A\MyByndle:Dir:index.html.twig #}

{% block something %}
   ... default markup goes here ...
{% endblock %}
{# B\MyBundle:Dir:index.html.twig #}

{% extends 'A\MyBundle:Dir:index.html.twig' %}

{% block something %}
    ... something different ...
{% endblock %}

This will throw a "reached nested level" error. Read something about missing the scope in the template loader. There are also some fixes out there, but this should be fixed and covered by default I guess?!

For now I made override the controller and action too, and use another filename for the "index" view but this should be possible in terms of overriding bundles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0