owen777
8 years agoBinge Watcher
Default assocarray field's value
Hey, what's the correct way of setting default assocarray field's value in XML? Is there any? I'm able to set only an empty object via:
but none of the following works:
I need to set such default value inside field's declaration because if I'm setting it in inside the init() function, from time to time, when trying to get "headers" field value right after object creation, it's Invalid.
<field id="headers" type="assocarray" value="{}" />but none of the following works:
<field id="headers" type="assocarray" value="{test: value}" />
<field id="headers" type="assocarray" value='{test: "value"}' />
<field id="headers" type="assocarray" value='{"test": "value"}' />
<field id="headers" type="assocarray" value="{test: \"value\"}" />
<field id="headers" type="assocarray" value="{\"test\": \"value\"}" />I need to set such default value inside field's declaration because if I'm setting it in inside the init() function, from time to time, when trying to get "headers" field value right after object creation, it's Invalid.