false, "type" => "script", "url" => "", "text" => ""); public function __construct($name) { // Set dummy data so we don"t get errors $this->attr["action"] = ""; $this->attr["method"] = "post"; $this->data["name"] = $name; } public function __get($key) { return isset($this->data[$key]) ? $this->data[$key] : null; } /** * Sets url attribute */ public function url($url) { $this->data["url"] = $url; return $this; } public function text($script_text) { $this->data["text"] = $script_text; return $this; } public function render($template="forge_template", $custom=false) { $script = array(); if (!empty($this->data["url"])) { $script[] = html::script($this->data["url"]); } if (!empty($this->data["text"])) { $script[] = "\n"; } return implode("\n", $script); } }