|
cbuser35
Coronel
Joined: 03/04/09
Posts: 69 |
using json in config.xml?
03/16/10 4:47 PM
Hi,
I use json notation in my coldbox.xml file:
<Setting name="security_accessLevels" value="{'usermanagement':1,'addmenu':2,'deletemenu':2,'addpage':2,'deletePage':2,editmenu':3,'editpage':3};" />
When I request the value of this setting in a cfc
<cfproperty name="securityAccessLevels" type="coldbox:setting:security_accessLevels" scope="variables">
[...]
<cfdump var="#securityAccessLevels#"> <cfabort>
I get this response:
{'usermanagement':1,'addmenu':2,'deletemenu':2,'addpage':2,'deletePage':2,editmenu':3,'editpage':3};
I understood from the docs CB would convert this to a coldfusion struct instead of literally returning this string... Am I wrong? If so, what's the advantage of using Json in the config.xml??
I use CB 2.6.3
Thanks
Marc
|
|
Link | Top | Bottom
|
cbuser35
Coronel
Joined: 03/04/09
Posts: 69 |
RE: using json in config.xml?
03/17/10 2:26 AM
Ok, fixed. My json was invalid. Should be like this:
<Setting name="security_accessLevels" value="{usermanagement:'1',addmenu:'2',deletemenu:'2',addpage:'2',deletePage:'2',editmenu:'3',editpage:'3'}" />
Now I get a nice CF struct.
Coldbox rocks!
Marc
|
|
Link | Top | Bottom
|
|