/** * @return string */ public function buildHtml() { // TODO LOW remove this "if" statement, trigger a notice, debug step by step and optimize // this "if" patch is here because parseSingleValue() calls this both : we have to build html // on first pass only. if (is_array($this->value)) { // - edit if ($this->template instanceof Html_Template) { $map = new Html_Builder_Map($this->property, $this->value); $map->setTemplate($this->template); } else { $map = new Map($this->property, $this->value); } // build return $map->build(); } else { return $this->value; } }
/** * @return string */ private function buildMap() { if (!isset($this->template)) { $this->template = new Html_Template(); } if (!$this->value) { $this->value = []; } $preprop = substr($this->preprop, -2) == '[]' ? $this->getFieldName() : $this->preprop; $map = new Html_Builder_Map($this->property, $this->value, $preprop); $map->setTemplate($this->template); return $map->build(); }