-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
fusioncms/cms
#39Description
Describe the issue
When using theme() helper to access values from the theme.json file, it will return a string value as expected. But if something is formatted as an array, the dot notation built into the helper flattens and formats the array.
To reproduce
This specific issue came up when wanting to define a list of supported languages for a theme. JSON looks like this:
"languages": [
{
"name": "English",
"value": "en"
}
]
And I'm trying to access and loop through the values like so in my view file:
@foreach (theme('languages') as $lang)
<a href="{{ url('locale/' . $lang->value) }}">{{ $lang->name }}</a>
@endforeach
But the array is being flattened into the following way, making the data inaccessible:
Version and browser
Version: Master
Bug report checklist
- I have filled out as much information as I can
- I have detailed how the issue can be reproduced
- I have searched for existing issues and to the best of my knowledge this is not a duplicate
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't working
