rain_gloom Posted August 31, 2015 Share Posted August 31, 2015 (edited) edit: I'm curious about setting values of the form "[]" being automatically interpreted and also what the `accept` attribute do and what its syntax is? I've found out a few days ago that the settings system is capable of more than just storing plaintext and actually seems to support something like JSON. (I don't have much experience with JSON, but the syntax seems like JSON for me) This raised a few questions that the docs do not mention. How are values interpreted? What's the syntax of the "accept" attribute? Edited September 1, 2015 by Guest Link to comment
MIKI785 Posted September 1, 2015 Share Posted September 1, 2015 Wll obviously it can store JSON, because JSON is really just a string (text). Thats why its used, mainly so that you can store tables as text values in databases. Link to comment
rain_gloom Posted September 1, 2015 Author Share Posted September 1, 2015 Yes, I realize that, but it seems it automatically interprets JSON. Try making a setting with a value like "[true]" or "[1]" or "[[1,2,3]]" and print the type of whatever `get ""` returns. If the value is enclosed in [], it will be automatically converted. edit: Maybe I should clarify the original question then. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now