Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The problem of how to represent arbitrary data types as strings always runs up against exactly the problem you're describing and it has been solved in many ways already. This process is called <em>serialization</em> and there are many serialization formats, anything from PHP's native <a href="http://php.net/serialize" rel="nofollow"><code>serialize</code></a> to <a href="http://en.wikipedia.org/wiki/JSON" rel="nofollow">JSON</a> to XML. All these formats specify how to present complex data structures as strings, including <em>escaping rules</em> for how to use characters that have a special meaning in the serialization format in the serialized values themselves.</p> <hr> <p>From the comments:</p> <blockquote> <p>Ok, well, basically, it's straight forward. I already outlined 13 of the other parameters and how they work in Dream Portal located here: <a href="http://dream-portal.net/topic_122.0.html" rel="nofollow">http://dream-portal.net/topic_122.0.html</a> so, you can see how they fit in. I'm working on a fieldset parameter that basically uses all of these parameters and than some to include multiple parameters into 1. Anyways, hope that link helps you, for an idea of what an XML file looks like for a module: <a href="http://dream-portal.net/topic_98.0.html" rel="nofollow">http://dream-portal.net/topic_98.0.html</a> look at the info.xml section, pay attention to the <code>&lt;param&gt;</code> tag in there, at the bottom, 2 of them. </p> </blockquote> <p>It seems to me that a more sensible use of XML would make this a lot easier. I haven't read the whole thing in detail, but an XML element like</p> <pre><code>&lt;param name="test_param" type="select"&gt;0:opt1;opt2;opt3&lt;/param&gt; </code></pre> <p>would make much more sense written as</p> <pre><code>&lt;select name="test_param"&gt; &lt;option default&gt;opt1&lt;/option&gt; &lt;option&gt;opt2&lt;/option&gt; &lt;option&gt;opt3&lt;/option&gt; &lt;/select&gt; </code></pre> <p>Each unique configuration option can have its own unique element namespace with custom sub-elements depending on the type of parameter you need to represent. Then there's no need to invent a custom mini-format for each possible parameter. It also allows you to create a formal <a href="http://en.wikipedia.org/wiki/XML_schema" rel="nofollow">XML schema</a> (whether this will do you any good or not is a different topic, but at least you're using XML as it was meant to be used).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload