From 3a9f332f434c2213c27aecb47b23bbb067e81c87 Mon Sep 17 00:00:00 2001 From: Hassaan Ali Date: Fri, 17 Feb 2023 17:00:48 +0500 Subject: [PATCH 1/2] Update DbView.php --- src/Flynsarmy/DbBladeCompiler/DbView.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Flynsarmy/DbBladeCompiler/DbView.php b/src/Flynsarmy/DbBladeCompiler/DbView.php index 6660aa1..5ce4f01 100755 --- a/src/Flynsarmy/DbBladeCompiler/DbView.php +++ b/src/Flynsarmy/DbBladeCompiler/DbView.php @@ -109,8 +109,10 @@ protected function getContents() { $field = $this->config->get('db-blade-compiler.model_property'); $this->path->{$field} = $this->content_field; + $compiler = $this->engine->getCompiler(); + $compiler->compile($this->path); - return parent::getContents(); + return $this->engine->getContent($compiler->getCompiledPath($this->path), $this->data); } /** From 86222654318c62da565f3b8b935b8be1e0f843aa Mon Sep 17 00:00:00 2001 From: Hassaan Ali Date: Fri, 17 Feb 2023 17:37:56 +0500 Subject: [PATCH 2/2] Update DbBladeCompilerEngine.php --- .../DbBladeCompiler/DbBladeCompilerEngine.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Flynsarmy/DbBladeCompiler/DbBladeCompilerEngine.php b/src/Flynsarmy/DbBladeCompiler/DbBladeCompilerEngine.php index be31183..c477162 100644 --- a/src/Flynsarmy/DbBladeCompiler/DbBladeCompilerEngine.php +++ b/src/Flynsarmy/DbBladeCompiler/DbBladeCompilerEngine.php @@ -13,4 +13,14 @@ public function __construct(DbBladeCompiler $bladeCompiler) { parent::__construct($bladeCompiler); } + + /** + * @param string $compiled_path + * @param array $data + * @return string + */ + public function getContent(string $compiled_path, array $data) + { + return $this->evaluatePath($compiled_path, $data); + } }