[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [jfw] Bringing the forms package up to scratch
Hi. I've just started on this and I'm not sure I understand the issue... What's wrong with parsing the XML like this:
public function stringToObject($data, array $options = array())
// Parse the XML string.
$xml = simplexml_load_string($data);
$obj = json_decode(json_encode($xml));
That way we have a real representation of the XML data and it makes it easy to create a form from this. I'm not too keen on the attributes being inside @attributes, but that can easy be changed by recursively looping through the object.
To determine what format this should be saved as it would be good to agree on how non XML forms should be. I personally quite like the idea of loading a JSON string like this:
On Thursday, 13 March 2014 10:59:16 UTC+1, piotr_cz wrote:
I don't think an XML object can be simply converted to Registry. If we would manage to do so, I'm afraid it would be easier to manipulate XMLDocument than Registry result.
On Wednesday, March 12, 2014 5:36:55 PM UTC+1, Adam Bouqdib wrote:
Ah I see. I'll have a closer look at that first then. If I update the XML package of Registry should I report back here or just create a pull request?
On 12 March 2014 17:29, Don Gilbert <dilber... AT gmail.com>
Main issue was the XML support in Registry. It doesn't use clear semantic markup. Instead of <form><fieldset><field name="foo"></fieldset></form> it uses <node name="form"><node name="fieldset">etc</node></node> - It's not a good representation of the data.
Framework source code: https://github.com/joomla/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.