# css-javascript-toolbox/8.2/framework/html/dom/element/script.php

CSS &amp; JavaScript Toolbox, version 8.2. 66 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/8.2/code/framework/html/dom/element/script.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/8.2/raw/framework/html/dom/element/script.php
- Modified: 2016-03-05T15:13:58+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.2/code/framework/html/dom/element/script.php#L10-L20`.

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

class CJT_Framework_Html_Dom_Element_Script
extends CJT_Framework_Html_Dom_Elementbase {
	
	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	protected $vars;
	
	/**
	* put your comment there...
	* 
	*/
	public function __construct() {
		// Create script element.
		parent::__construct('script');
		// INitialize vars.
		$this->vars = new ArrayObject(array());
		// INitialize with defauls.
		$this->setType('text/javascript');
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function __toString() {
		// Set vars.
		$content = '';
		$vars =& $this->vars();
		foreach ($vars as $var => $value) {
			$content .= "var {$var}={$value};";
		}
		$this->setContent($content);
		// Get parent string.
		return parent::__toString();
	}

	/**
	* put your comment there...
	* 
	* @param mixed $type
	*/
	public function & setType($type) {
		// Set type.
		$this->setAttribute('type', $type);
		// chain.
		return $this;
	}

	/**
	* put your comment there...
	* 
	*/
	public function & vars() {
		return $this->vars;
	}

} // End class.

```
