Skip to content

Commit

Permalink
minor #1960 [TwigComponent] allow attributes to be prefixed with @
Browse files Browse the repository at this point in the history
…(kbond)

This PR was merged into the 2.x branch.

Discussion
----------

[TwigComponent] allow attributes to be prefixed with `@`

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Issues        | Fix (partial) #1839
| License       | MIT

Allow attributes to be prefixed with `@` (like ``@click`="!open"`).

Commits
-------

c567cbb fix: allow attributes to be prefixed with `@`
  • Loading branch information
kbond committed Jul 6, 2024
2 parents fa3f0c6 + c567cbb commit bdb5bc3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,15 @@ public function testRenderingHtmlSyntaxComponentWithNestedAttributes(): void

$output = self::getContainer()
->get(Environment::class)
->createTemplate('<twig:NestedAttributes class="foo" title:class="bar" title:span:class="baz" inner:class="foo" />')
->createTemplate('<twig:NestedAttributes class="foo" title:class="bar" title:span:class="baz" inner:class="foo" inner:@class="qux" @class="vex" />')
->render()
;

$this->assertSame(<<<HTML
<main class="foo">
<main class="foo" @class="vex">
<div class="bar">
<span class="baz">
<div class="foo"/>
<div class="foo" @class="qux"/>
</span>
</div>
Expand Down

0 comments on commit bdb5bc3

Please sign in to comment.