/** * * @param unknown_type $data an array containing * the expected data to be displayed (in the HTML * format). If this variable is not an array, the row * is simply ignored. * * @return the row. */ public function getRow($data) { $ret = ''; if (is_array($data)) { $options = array(); $rowstyle = ''; if (isset($data['tr-style'])) { $rowstyle = $data["tr-style"]; if (strlen($rowstyle) > 0) { $options["style"] = $rowstyle; } } if (strlen($rowstyle) > 0) { $options["style"] = $rowstyle; } if (isset($data['tr-class'])) { $options['class'] = $data["tr-class"]; } $ret .= std::tagln("tr", $options); foreach ($this->headers as $key => $value) { $opt = array(); $val = @$data[$key]; $style = ''; if (isset($data["{$key}-style"])) { $style = $data["{$key}-style"]; } if (isset($data["{$key}-order"])) { $opt['data-order'] = $data["{$key}-order"]; } if ($style || $rowstyle) { $opt["style"] = $style . $rowstyle; } if ($this->columns[$key]['plain']) { $val = std::html($val); } $ret .= " " . std::tag("td", $opt) . $val . std::tagln("/td"); } $ret .= std::tagln("/tr"); } return $ret; }
public function testTagln() { $this->assertEquals(std::tagln("p"), "<p>\n"); }
/** * Create a <META> tag. * * @param string $key the data for the "name" attribute. * @param string $value the data for the "content" attribute. */ public function meta($key, $value) { return $this->getTabulation() . std::tagln("meta", ['name' => $key, 'content' => $value]); }