PluginProbe
CSS & JavaScript Toolbox / 11
CSS & JavaScript Toolbox v11
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
css-javascript-toolbox / framework / xml / fetchscalars.php

fetchscalars.php in CSS & JavaScript Toolbox 11, at framework/xml/fetchscalars.php

32 lines 647 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 /**
7 *
8 */
9 class CJT_Framework_Xml_Fetchscalars extends ArrayIterator {
10
11 /**
12 * put your comment there...
13 *
14 * @param SimpleXMLElement $element
15 * @return CJT_Framework_Xml_Fetchscalars
16 */
17 public function __construct(SimpleXMLElement $element) {
18 $data = array();
19 // Read all Child elements with no childs inside.
20 foreach ($element->children() as $field => $child) {
21 // Read all elements with no childs inside!
22 // Only with text data!
23 if (!count($child->children())) {
24 $data[$field] = (string) $child;
25 }
26 }
27 // Load array iterator with fetched data.
28 parent::__construct($data);
29 }
30
31
32 } // End class.