Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("$prefix/utils/Element.php");
- class Div extends Element {
- function Div($id = "", $class = "") {
- $this->_id = $id;
- if ($class != "") $this->addClass($class);
- }
- public function html() {
- $ret = '<div';
- if ($this->hasIdAttr()) {
- $ret = rtrim(sprintf("%s %s", $ret, $this->getIdAttr()));
- }
- if ($this->hasClassAttr()) {
- $ret = rtrim(sprintf("%s %s", $ret, $this->getClassAttr()));
- }
- if ($this->hasStyleAttr()) {
- $ret = rtrim(sprintf("%s %s", $ret, $this->getStyleAttr()));
- }
- $ret .= ">\n";
- for ($i = 0; $i < $this->_idx; $i++) {
- $ret .= $this->_elements[$i]->html() . "\n";
- }
- $ret .= "</div>\n";
- return $ret;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement