WIP
This commit is contained in:
@@ -55,14 +55,14 @@ class RadThemeEngine
|
|||||||
{
|
{
|
||||||
return function ($template, $context, $args, $source) {
|
return function ($template, $context, $args, $source) {
|
||||||
$output = "";
|
$output = "";
|
||||||
die(var_dump($context->get($args)));
|
|
||||||
$groups = json_decode($context->get($args));
|
if (!is_iterable($context->get($args))) {
|
||||||
foreach ($groups as $g) {
|
return "Sorry, the item you passed to the flex helper is not iterable.";
|
||||||
$data = [];
|
|
||||||
foreach ($g->fields as $f) {
|
|
||||||
$data[$f->name] = $f->value;
|
|
||||||
}
|
}
|
||||||
$output .= site()->render($g->tpl, $data);
|
|
||||||
|
$groups = $context->get($args);
|
||||||
|
foreach ($groups as $g) {
|
||||||
|
$output .= site()->render($g->tpl, $g);
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user