From 7dce6e0c8411ee99eccdc0786a7582745fb28be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kh=C3=A1nh=20Tr=E1=BA=A7n?= Date: Sun, 28 Sep 2014 18:04:35 +0700 Subject: [PATCH] Update ElementsBehaviour.php Fixed bug view can not be resolved because of missing view path in addHtml method. --- src/Form/Behaviour/ElementsBehaviour.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Form/Behaviour/ElementsBehaviour.php b/src/Form/Behaviour/ElementsBehaviour.php index 98c1026..8a3c298 100644 --- a/src/Form/Behaviour/ElementsBehaviour.php +++ b/src/Form/Behaviour/ElementsBehaviour.php @@ -71,10 +71,13 @@ public function addHtml($name, $value = null, $partial = false) /** @var View $view */ $view = $this->getDI()->get('view'); + $curViewDir = $view->getViewsDir (); + $view->setViewsDir(ROOT_PATH . '/app/modules/'); ob_start(); $view->partial($value, $partial); $html = ob_get_contents(); ob_end_clean(); + $view->setViewsDir($curViewDir); $element->setValue($html); } else { $element->setValue($value); @@ -596,4 +599,4 @@ public function addMultiSelect( $name = $name . '[]'; return $this->addSelect($name, $label, $description, $elementOptions, $value, $options, $attributes); } -} \ No newline at end of file +}