PluginProbe
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager / 10
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager v10
10.56 1.2.1 10 10.1 10.2 10.3 10.31 10.32 10.33 10.34 10.50 10.51 10.52 10.53 10.55 9.0 9.0.1 9.4 trunk 1.0.0 1.1 1.2
easy-code-manager / framework / html / dom / elementbase.php

elementbase.php in FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager 10, at framework/html/dom/elementbase.php

70 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 class CJT_Framework_Html_Dom_Elementbase {
7
8 /**
9 * put your comment there...
10 *
11 * @var SimpleXMLElement
12 */
13 protected $simpleXML;
14
15 /**
16 * put your comment there...
17 *
18 * @param mixed $tag
19 * @return CJT_Framework_Html_Dom_Elementbase
20 */
21 public function __construct($tag) {
22 // Build XML Content.
23 $xmlContent = "<root><{$tag}></{$tag}></root>";
24 // Create SIMPLEXMLElement.
25 $this->simpleXML = new SimpleXMLElement($xmlContent);
26 // Target the tag element.
27 $children = $this->getSimpleXML()->children();
28 $this->simpleXML = $children[0];
29 }
30
31 /**
32 * put your comment there...
33 *
34 */
35 public function __toString() {
36 return $this->getSimpleXML()->asXML();
37 }
38
39 /**
40 * put your comment there...
41 *
42 */
43 protected function & getSimpleXML() {
44 return $this->simpleXML;
45 }
46
47 /**
48 * put your comment there...
49 *
50 * @param mixed $name
51 * @param mixed $value
52 * @param mixed $ns
53 */
54 public function setAttribute($name, $value, $ns = null) {
55 return $this->getSimpleXML()->addAttribute($name, $value, $ns);
56 }
57
58 /**
59 * put your comment there...
60 *
61 * @param mixed $content
62 */
63 public function & setContent($content) {
64 // Set content.
65 $this->getSimpleXML()->{0} = $content;
66 // Chain.
67 return $this;
68 }
69 } // End class.
70