# css-javascript-toolbox/8.3.2/framework/html/dom/elementbase.php

CSS &amp; JavaScript Toolbox, version 8.3.2. 70 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/8.3.2/code/framework/html/dom/elementbase.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/8.3.2/raw/framework/html/dom/elementbase.php
- Modified: 2014-05-06T16:47:26+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/css-javascript-toolbox/8.3.2/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.

```
