[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/Form/ -> TagElement.php (source)

   1  <?php
   2  namespace dokuwiki\Form;
   3  
   4  /**
   5   * Class TagElement
   6   *
   7   * Creates a self closing HTML tag
   8   *
   9   * @package dokuwiki\Form
  10   */
  11  class TagElement extends ValueElement {
  12  
  13      /**
  14       * @param string $tag
  15       * @param array $attributes
  16       */
  17      public function __construct($tag, $attributes = array()) {
  18          parent::__construct('tag', $tag, $attributes);
  19      }
  20  
  21      /**
  22       * The HTML representation of this element
  23       *
  24       * @return string
  25       */
  26      public function toHTML() {
  27          return '<'.$this->val().' '.buildAttributes($this->attrs()).' />';
  28      }
  29  }