Exakat\Reports\Devoops::formatSectionedHashTable PHP Метод

formatSectionedHashTable() защищенный Метод

protected formatSectionedHashTable ( $data, $css )
    protected function formatSectionedHashTable($data, $css)
    {
        static $counter;
        if (!isset($counter)) {
            $counter = 1;
        } else {
            ++$counter;
        }
        $text = <<<HTML
<table id="sectionedhashtable-{$counter}" class="table">
\t\t\t\t\t\t\t\t\t\t<thead>
HTML;
        if ($css->displayTitles === true) {
            $text .= '<tr>';
            foreach ($css->titles as $title) {
                $text .= <<<HTML
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th>
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{$title}
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</th>

HTML;
            }
            $text .= '</tr>';
        }
        $text .= <<<HTML
\t\t\t\t\t\t\t\t\t\t</thead>

\t\t\t\t\t\t\t\t\t\t<tbody>
HTML;
        foreach ($data as $k => $v) {
            $text .= "<tr class=\"primary\"><td>{$k}</td><td>&nbsp;</td></tr>\n";
            if (is_array($v)) {
                foreach ($v as $k2 => $v2) {
                    $text .= "<tr><td>{$k2}</td><td>{$v2}</td></tr>\n";
                }
            }
        }
        $text .= <<<HTML
\t\t\t\t\t\t\t\t\t\t</tbody>
\t\t\t\t\t\t\t\t\t</table>
HTML;
        return $text;
    }