Skip to content

[RFC] Automatically fallback on outerScopeΒ #2897

Open
@lyrixx

Description

@lyrixx

Description

We started to use twig components πŸŽ‰

But we face a DX issue. Allow me to show some code:

    <twig:Table:Root>
        <twig:Table:Thead>
            <twig:Table:Tr>
                {% for column in outerScope.outerScope.outerScope.computed.columns %}
                    <twig:Table:Th>
                        {{ column.label }}
                    </twig:Table:Th>
                {% endfor %}
                <twig:Table:Th>
                    Actions
                </twig:Table:Th>
            </twig:Table:Tr>
        </twig:Table:Thead>

As you can see, we have to write:

outerScope.outerScope.outerScope.computed.columns

πŸ₯΅


So quick question : Could we automatically search in outerscope when something is not found in the current context?

This would allow us to write:

computed.columns

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions