Example #1
0
 /**
  * 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;
 }
Example #2
0
 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;
 }
Example #3
0
 /**
  * Set the MIME type for this document.
  * @param string $mime New MIME type for this document.
  */
 public static function setMimeType($mime)
 {
     self::$mimeType = $mime;
 }
Example #4
0
 public function output()
 {
     return XHtmlDocument::escape($this->text);
 }