/** * Output a string representing all of this element's attributes. * @return string XHTML representation of this elemtn's attributes. */ protected function outputAttributes() { $out = ''; foreach ($this->attributes as $attr => $value) { $a = XHtmlDocument::escape($attr); $v = XHtmlDocument::escape($value); $out .= ' ' . $a . '="' . $v . '"'; } return $out; }
public function pretty($indlevel = 0) { $str = ''; if ($this->label) { $str .= str_repeat(' ', $indlevel * XHtmlDocument::PRETTY_TAB_WIDTH); $id = XHtmlDocument::escape($this->getAttribute('id')); $str .= '<label for="' . $id . '">' . $this->label . "</label>\n"; } $str .= str_repeat(' ', $indlevel * XHtmlDocument::PRETTY_TAB_WIDTH); $str .= '<input' . $this->outputAttributes() . "/>\n"; return $str; }
/** * Set the MIME type for this document. * @param string $mime New MIME type for this document. */ public static function setMimeType($mime) { self::$mimeType = $mime; }
public function output() { return XHtmlDocument::escape($this->text); }