Skip to content

Commit

Permalink
Add support for Stringable
Browse files Browse the repository at this point in the history
  • Loading branch information
nlemoine committed Dec 18, 2024
1 parent e2a985b commit c2e9e22
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions extra/html-extra/Tests/Fixtures/html_classes.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
{{ html_classes('a', {'b': true, 'c': false}, 'd', false ? 'e', true ? 'f', '0') }}
{% set class_a = 'a' %}
{% set class_b = 'b' %}
{%- set class_c -%}
c
{%- set class_d -%}
d
{%- endset -%}
{{ html_classes(class_a, {(class_b): true})}}
{{ html_classes(class_a, {(class_c): true})}}
{{ html_classes(class_a, class_c, {(class_d): true})}}
--DATA--
return []
return [
'class_c' => new class implements Stringable {
public function __toString(): string
{
return 'c';
}
},
]
--EXPECT--
a b d f 0
a b
a c
a c d

0 comments on commit c2e9e22

Please sign in to comment.