]> git.sesse.net Git - xml-template/commitdiff
Make the PHP attribute-empty hack less ugly.
authorsgunderson@bigfoot.com <>
Wed, 4 Oct 2006 01:12:56 +0000 (03:12 +0200)
committersgunderson@bigfoot.com <>
Wed, 4 Oct 2006 01:12:56 +0000 (03:12 +0200)
php/attribute-empty.php

index e2f02338a6024bf8d96729a9b097b3bdc85ee3b2..d4611404f0503d755f5f2ed56c4f93b669a1bf87 100644 (file)
@@ -1,9 +1,12 @@
 <?php
 require('xml-template.php');
 
+# NULL values are ignored, but having one helps pointing out that
+# the array given is non-associative
+
 $doc = XML_Template_process_file('../xml/clone.xml', array(
        'color' => 'blue',
-       '#things' => ''             # no better way to do it, I'm afraid
+       '#things' => array(NULL)
 ));
 print $doc->dump_mem();
 ?>