Skip to content

Commit 9fa083c

Browse files
Update helpers.php
1 parent 83f63b4 commit 9fa083c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

helpers.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ function snippet_controller(string|array $name, array $data = []): array
4040
$value = F::load($value);
4141
}
4242

43+
if (is_array($value)) {
44+
return array_merge($value, $data);
45+
}
46+
4347
if ($value instanceof Closure) {
4448
$value = (new Controller($value))->call(App::instance(), $data);
4549
}
4650

47-
return is_array($value) ? array_merge($value, $data) : $data;
51+
return is_array($value) ? array_merge($data, $value) : $data;
4852
}
4953
}

0 commit comments

Comments
 (0)