Skip to content

"Cache may be corrupt" when switching from "self closing tag" notation to "container tag" and backslash "\" is in template path #3135

@Jalliuz

Description

@Jalliuz

I have this TextMessagesButton.php file

#[AsLiveComponent('TextMessagesButton', template: 'Dossier\TextMessagesButton.html.twig')] final class TextMessagesButton {} 

This works if I use the self closing tag in twig

<twig:TextMessagesButton /> 

But not when using the container tag notation:

<twig:TextMessagesButton> Some content </twig:TextMessagesButton> 

The problem is the backslash in my template path
I wrote accidentally "'Dossier\TextMessagesButton.html.twig" with a backslash but it worked with a self-closing tag

The fix is to always use forward slashes in paths of course.
The question is, what is the bug, the fact that backslashes work in self closing tags? Or that they don't work in container tags? :) The documentation uses forward slashes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions