Skip to content

Slot content is not being inserted into the component #32

Description

@bytespider

Versions:
PHP: 7.4.33
Twig: 3.11.3

Reproducing

// component/button.twig
<button {{ attributes.merge({ class: 'text-white' }) }}>{{ slot }}</button>
// page.twig
{% x:button with {class:'bg-blue-600'} %} test {% endx %}

Result

<html>
  <head>
  </head>
  <body>test <button class="bg-blue-600 text-white"></button>
  </body>
</html>

Solution

When I downgrade to Twig 3.0.5 the code above work as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions