Skip to content

Commit be896fe

Browse files
committed
Change attributes with if condition
1 parent 033acab commit be896fe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Compiler.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,9 @@ private function replaceScopedPlaceholders(string $html): string
12861286
return $html;
12871287
}
12881288

1289+
/**
1290+
* @throws ReflectionException
1291+
*/
12891292
private function replaceAttributeWithIfConditionPlaceholders(string $html): string
12901293
{
12911294
$pattern = '/__ATTRIBUTE_WITH_IF_CONDITION__="([-a-zA-Z0-9]+)\|([a-zA-Z0-9+=]+)"/';
@@ -1294,6 +1297,8 @@ private function replaceAttributeWithIfConditionPlaceholders(string $html): stri
12941297
$name = $match[1];
12951298
$value = base64_decode($match[2]);
12961299
$condition = trim(str_replace(['__DOUBLE_CURLY_OPEN__', '__DOUBLE_CURLY_CLOSE__'], '', $value));
1300+
$value = $this->replacePlaceholders($value);
1301+
$condition = $this->replacePlaceholders($condition);
12971302
if (in_array($name, ['checked', 'selected', 'disabled'])) {
12981303
$value = $name;
12991304
}

0 commit comments

Comments
 (0)