From 0a78b6d4bd64f16de1274a7f28f53cf1d9378cb5 Mon Sep 17 00:00:00 2001 From: SonyPradana Date: Tue, 17 Sep 2024 13:51:32 +0700 Subject: [PATCH] add to exclude list directly --- src/System/View/Templator/DirectiveTemplator.php | 1 + src/System/View/Templator/JsonTemplator.php | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/System/View/Templator/DirectiveTemplator.php b/src/System/View/Templator/DirectiveTemplator.php index 9d650137..e395f25d 100644 --- a/src/System/View/Templator/DirectiveTemplator.php +++ b/src/System/View/Templator/DirectiveTemplator.php @@ -28,6 +28,7 @@ class DirectiveTemplator extends AbstractTemplatorParse 'foreach' => EachTemplator::class, 'if' => IfTemplator::class, 'include' => IncludeTemplator::class, + 'json' => JsonTemplator::class, 'php' => PHPTemplator::class, 'raw' => NameTemplator::class, 'section' => SectionTemplator::class, diff --git a/src/System/View/Templator/JsonTemplator.php b/src/System/View/Templator/JsonTemplator.php index e33c5102..9fecc830 100644 --- a/src/System/View/Templator/JsonTemplator.php +++ b/src/System/View/Templator/JsonTemplator.php @@ -10,8 +10,6 @@ class JsonTemplator extends AbstractTemplatorParse { public function parse(string $template): string { - DirectiveTemplator::$excludeList['json'] = JsonTemplator::class; - return preg_replace_callback( '/{%\s*json\(\s*(.+?)\s*(?:,\s*(\d+)\s*)?(?:,\s*(\d+)\s*)?\)\s*%}/', static function ($matches): string {