Skip to content

Commit 5719855

Browse files
committed
Return a Fluent instance for block config
fix wintercms#23
1 parent 2e746a7 commit 5719855

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

classes/Block.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
use Cms\Classes\ComponentManager;
99
use Cms\Classes\Controller;
1010
use Cms\Classes\PartialStack;
11-
use Lang;
11+
use Illuminate\Support\Facades\Lang;
12+
use Illuminate\Support\Fluent;
1213
use Winter\Storm\Exception\SystemException;
1314

1415
/**
@@ -101,11 +102,13 @@ public static function renderAll(array $blocks, ?Controller $controller = null):
101102
$partialData['data'] = $partialData;
102103

103104
if (!empty($block['_config'])) {
104-
$partialData['config'] = json_decode($block['_config']);
105+
$config = json_decode($block['_config']);
105106
} else {
106-
$partialData['config'] = static::getDefaultConfig($block['_group']);
107+
$config = static::getDefaultConfig($block['_group']);
107108
}
108109

110+
$partialData['config'] = new Fluent($config);
111+
109112
$content .= $controller->renderPartial($block['_group'] . '.block', $partialData);
110113
}
111114

0 commit comments

Comments
 (0)