Skip to content

Commit 002bebc

Browse files
author
matheo
committed
rename default block to block content
1 parent 102c5f4 commit 002bebc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/TwigComponent/src/Twig/TwigPreLexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function preLexComponents(string $input): string
101101
&& preg_match('/\S/', $char)
102102
) {
103103
$this->currentComponents[\count($this->currentComponents) - 1]['hasDefaultBlock'] = true;
104-
$output .= '{% block default %}';
104+
$output .= '{% block content %}';
105105
}
106106

107107
$output .= $char;

src/TwigComponent/tests/Unit/TwigPreLexerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ public function getLexTests(): iterable
6464

6565
yield 'component_with_default_block_content' => [
6666
'<t:foo>Foo</t:foo>',
67-
'{% component foo %}{% block default %}Foo{% endblock %}{% endcomponent %}',
67+
'{% component foo %}{% block content %}Foo{% endblock %}{% endcomponent %}',
6868
];
6969

7070
yield 'component_with_default_block_that_holds_a_component_and_multi_blocks' => [
7171
'<t:foo>Foo <t:bar /><t:block name="other_block">Other block</t:block></t:foo>',
72-
'{% component foo %}{% block default %}Foo {% component bar %}{% endcomponent %}{% endblock %}{% block other_block %}Other block{% endblock %}{% endcomponent %}',
72+
'{% component foo %}{% block content %}Foo {% component bar %}{% endcomponent %}{% endblock %}{% block other_block %}Other block{% endblock %}{% endcomponent %}',
7373
];
7474
}
7575
}

0 commit comments

Comments
 (0)