PluginProbe
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager / 1.2
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager v1.2
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 / element / script.php

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

66 lines 1.0 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_Element_Script
7 extends CJT_Framework_Html_Dom_Elementbase {
8
9 /**
10 * put your comment there...
11 *
12 * @var mixed
13 */
14 protected $vars;
15
16 /**
17 * put your comment there...
18 *
19 */
20 public function __construct() {
21 // Create script element.
22 parent::__construct('script');
23 // INitialize vars.
24 $this->vars = new ArrayObject(array());
25 // INitialize with defauls.
26 $this->setType('text/javascript');
27 }
28
29 /**
30 * put your comment there...
31 *
32 */
33 public function __toString() {
34 // Set vars.
35 $content = '';
36 $vars =& $this->vars();
37 foreach ($vars as $var => $value) {
38 $content .= "var {$var}={$value};";
39 }
40 $this->setContent($content);
41 // Get parent string.
42 return parent::__toString();
43 }
44
45 /**
46 * put your comment there...
47 *
48 * @param mixed $type
49 */
50 public function & setType($type) {
51 // Set type.
52 $this->setAttribute('type', $type);
53 // chain.
54 return $this;
55 }
56
57 /**
58 * put your comment there...
59 *
60 */
61 public function & vars() {
62 return $this->vars;
63 }
64
65 } // End class.
66