<?php

class HtmlItem
{
  /**
   * @var string
   */
  public $tag;
  /**
   * @var Array
   */
  public $attributes = array();
  /**
   *
   * @var string
  */
  public $html = "";

  public function __construct($tag)
  {
    $this->tag = $tag;
  }

  public function open()
  {
    $this->html = CHtml::tag($this->tag, $this->attributes, false, false);
  }

  public function close()
  {
    $this->html .= "</$tag>";
  }

  function __destruct()
  {
    close();
  }
}
