From bafe89561ee8683bec199ee109a96e1b739d9c88 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 23 Nov 2019 01:08:34 +0300 Subject: [PATCH] feat(core): add ability to extends fieldsets #301 change order for fieldsets extending. now it is works like twig templates "extends" somehow --- flextype/core/Forms.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flextype/core/Forms.php b/flextype/core/Forms.php index ea6025e5..24148a6c 100644 --- a/flextype/core/Forms.php +++ b/flextype/core/Forms.php @@ -94,12 +94,12 @@ class Forms if (is_array($fieldset['extends'])) { foreach ($fieldset['extends'] as $extends) { $extends_fieldset_content = Filesystem::read($this->flextype->fieldsets->getFileLocation($extends)); - $fieldset = array_replace_recursive($fieldset, $this->flextype->parser->decode($extends_fieldset_content, 'yaml')); + $fieldset = array_replace_recursive($this->flextype->parser->decode($extends_fieldset_content, 'yaml'), $fieldset); } } else { $extends_fieldset_content = Filesystem::read($this->flextype->fieldsets->getFileLocation($fieldset['extends'])); $extends_fieldset = $this->flextype->parser->decode($extends_fieldset_content, 'yaml'); - $fieldset = array_replace_recursive($fieldset, $extends_fieldset); + $fieldset = array_replace_recursive($extends_fieldset, $fieldset); } }