webismymind / editablegrid

EditableGrid is an open source Javascript library aimed at turning HTML tables into advanced editable components. It focuses on simplicity: only a few lines of code are required to get your first table up and running.
http://www.editablegrid.net
Other
795 stars 272 forks source link

use of native PHP facilities #22

Closed drzraf closed 11 years ago

drzraf commented 12 years ago

While looking at EditableGrid.php I found that most of the code relates to XML and JSON generation. PHP provides some facilities for this like simplexml and json* functions. Is there any technical reasons for not using them ?

webismymind commented 12 years ago

EditableGrid.php was started back in a time where I did not know (or at least care) about PHP's DOM XML and SimpleXML. So indeed, I already thought about modifying EditableGrid.php to use one of them, but it works as is so it was never a priority. And I don't think it would reduce the existing code that much, but it would indeed make it "more professional".

Moreover, we now use the JSON format in all our new projects. JSON has the advantage of being much more compact (especially when using $writeColumnNames=false in EditableGrid.php, which has recently become the default).

And for generating the JSON data, we do use PHP's json_encode.