From d5d32d9639f006111bc79f7571009abc02698c3c Mon Sep 17 00:00:00 2001 From: Timothy Morris Date: Mon, 27 Feb 2017 11:03:05 -0500 Subject: [PATCH] that gitignore was really mean, brian --- .gitignore | 1 - class.element.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) delete mode 100644 .gitignore create mode 100644 class.element.php diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 41a9caa..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -class.element.php diff --git a/class.element.php b/class.element.php new file mode 100644 index 0000000..5f4c70c --- /dev/null +++ b/class.element.php @@ -0,0 +1,29 @@ +tag = $t; + $this->content = $c; + $this->attrs = $a; + } + + public function setAttribute($name, $value) { + $this->attrs[$name] = $value; + } + + public function __toString() { + + $attr_string = ''; + foreach($this->attrs as $name => $value) { + $attr_string .= "{$name}='{$value}' "; + } + + return "<$this->tag $attr_string>$this->contenttag>"; + } + +} \ No newline at end of file