Open damsfx opened 10 months ago
Can we have a PR that just always converts it to either a stdClass or an array?
Can we have a PR that just always converts it to either a stdClass or an array?
It's on my to-do list ... but I'm running out of time.
A PR draft to add sorting on relationships has already taken up a lot of my time, but I'm getting there I think.
Which type do you think is best? @bennothommo, perhaps you have an opinion on the subject?
Since configs are ultimately stored through Halcyon (ie. the static content files in the theme), I think it should be an array for the best compatibility with that.
Block configs do not have to be used only with static pages, so I wouldn't necessarily use that as the deciding factor @bennothommo unless it actively causes issues to be in an stdClass form.
But yes, for simplicities sake I would prefer they were stored as arrays.
Context :
a block that define a config according to the documentation.
Case 1 :
Block added to the page, nothing changed in content, open/close the config inspector, page saved.
The config is available in the PHP section of the block as a
sdtClass
.Case 2 :
Block added to the page, nothing changed in content, page saved.
The config is available in the PHP section of the block as an
array
.Workaround :
Strictly typing the configuration,
As an array :
As an stdClass :