# easy-code-manager/1.2.1/framework/html/dom/elementbase.php

FluentSnippets – High-Performance Code Snippets, Header &amp; Footer Code, Custom CSS &amp; PHP Code Manager, version 1.2.1. 70 lines.

- Page: https://pluginprobe.com/plugins/easy-code-manager/1.2.1/code/framework/html/dom/elementbase.php
- Raw: https://pluginprobe.com/plugins/easy-code-manager/1.2.1/raw/framework/html/dom/elementbase.php
- Modified: 2018-11-20T15:24:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-code-manager/1.2.1/code/framework/html/dom/elementbase.php#L10-L20`.

```php
<?php
/**
* 
*/

class CJT_Framework_Html_Dom_Elementbase {

	/**
	* put your comment there...
	* 
	* @var SimpleXMLElement
	*/
	protected $simpleXML;
	
	/**
	* put your comment there...
	* 
	* @param mixed $tag
	* @return CJT_Framework_Html_Dom_Elementbase
	*/
	public function __construct($tag) {
		// Build XML Content.
		$xmlContent = "<root><{$tag}></{$tag}></root>";
		// Create SIMPLEXMLElement.
		$this->simpleXML = new SimpleXMLElement($xmlContent);
		// Target the tag element.
		$children = $this->getSimpleXML()->children();
		$this->simpleXML = $children[0];
	}

	/**
	* put your comment there...
	* 
	*/
	public function __toString() {
		return $this->getSimpleXML()->asXML();
	}

	/**
	* put your comment there...
	* 
	*/
	protected function & getSimpleXML() {
		return $this->simpleXML;
	}
	
	/**
	* put your comment there...
	* 
	* @param mixed $name
	* @param mixed $value
	* @param mixed $ns
	*/
	public function setAttribute($name, $value, $ns = null) {
		return $this->getSimpleXML()->addAttribute($name, $value, $ns);
	}

	/**
	* put your comment there...
	* 
	* @param mixed $content
	*/
	public function & setContent($content) {
		// Set content.
		$this->getSimpleXML()->{0} = $content;
		// Chain.
		return $this;
	}
} // End class.

```
