Skip to content

Commit 6e3f72d

Browse files
author
matheo
committed
change syntaxt to <t:
1 parent a9f4d9e commit 6e3f72d

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/TwigComponent/src/Twig/ComponentLexer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
class ComponentLexer extends Lexer
1010
{
1111
public const ATTRIBUTES_REGEX = '(?<attributes>(?:\s+[\w\-:.@]+(=(?:\\\"[^\\\"]*\\\"|\'[^\']*\'|[^\'\\\"=<>]+))?)*\s*)';
12-
public const OPEN_TAGS_REGEX = '/<\s*x-(?<name>([[\w\-\:\.]+))\s*'.self::ATTRIBUTES_REGEX.'(\s?)+>/';
13-
public const CLOSE_TAGS_REGEX = '/<\/\s*x-([\w\-\:\.]+)\s*>/';
14-
public const SELF_CLOSE_TAGS_REGEX = '/<\s*x-(?<name>([\w\-\:\.]+))\s*'.self::ATTRIBUTES_REGEX.'(\s?)+\/>/';
15-
public const BLOCK_TAGS_OPEN = '/<\s*x-block\s+name=("|\')(?<name>([\w\-\:\.]+))("|\')\s*>/';
16-
public const BLOCK_TAGS_CLOSE = '/<\s*\/\s*x-block\s*>/';
12+
public const OPEN_TAGS_REGEX = '/<\s*t:(?<name>([[\w\-\:\.]+))\s*'.self::ATTRIBUTES_REGEX.'(\s?)+>/';
13+
public const CLOSE_TAGS_REGEX = '/<\/\s*t:([\w\-\:\.]+)\s*>/';
14+
public const SELF_CLOSE_TAGS_REGEX = '/<\s*t:(?<name>([\w\-\:\.]+))\s*'.self::ATTRIBUTES_REGEX.'(\s?)+\/>/';
15+
public const BLOCK_TAGS_OPEN = '/<\s*t:block\s+name=("|\')(?<name>([\w\-\:\.]+))("|\')\s*>/';
16+
public const BLOCK_TAGS_CLOSE = '/<\s*\/\s*t:block\s*>/';
1717
public const ATTRIBUTE_BAG_REGEX = '/(?:^|\s+)\{\{\s*(attributes(?:.+?(?<!\s))?)\s*\}\}/x';
1818
public const ATTRIBUTE_KEY_VALUE_REGEX = '/(?<attribute>[\w\-:.@]+)(=(?<value>(\"[^\"]+\"|\\\'[^\\\']+\\\'|[^\s>]+)))?/x';
1919

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<x-table caption='data table' :headers='["key", "value"]' :data='[[1, 2], [3, 4]]'>
2-
<x-block name="th">custom th ({{ parent() }})</x-block>
3-
<x-block name="td">custom td ({{ parent() }})</x-block>
1+
<t:table caption='data table' :headers='["key", "value"]' :data='[[1, 2], [3, 4]]'>
2+
<t:block name="th">custom th ({{ parent() }})</t:block>
3+
<t:block name="td">custom td ({{ parent() }})</t:block>
44

5-
<x-block name="footer">
5+
<t:block name="footer">
66
My footer
7-
</x-block>
8-
</x-table>
7+
</t:block>
8+
</t:table>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<x-component_a propA propB='hello'>
2-
</x-component_a>
1+
<t:component_a propA propB='hello'>
2+
</t:component_a>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<x-component_a propA propB='hello'/>
1+
<t:component_a propA propB='hello'/>

0 commit comments

Comments
 (0)