. */ namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseHtml */ class ReportBaseHtml extends ReportBaseElement { /** @var string The XML tag. */ public $tag; /** @var string[] Attributes of the XML tag. */ public $attrs; /** @var ReportBaseElement[] A list of elements. */ public $elements = array(); /** * Create an element. * * @param $tag * @param $attrs */ public function __construct($tag, $attrs) { $this->tag = $tag; $this->attrs = $attrs; return 0; } /** * Get the start tag. * * @return string */ public function getStart() { $str = "<" . $this->tag . " "; foreach ($this->attrs as $key => $value) { $str .= $key . "=\"" . $value . "\" "; } $str .= ">"; return $str; } /** * Get the end tag. * * @return string */ public function getEnd() { return "tag . ">"; } /** * Add an element. * * @param ReportBaseElement $element */ public function addElement($element) { $this->elements[] = $element; } }