示例#1
0
<?php

if (isset($this->title)) {
    ?>

	  <?php 
    wtk_txt_data($this->title, $_indent, $_width);
    $title = $this->title->render();
    if ($level == 1) {
        echo "\n";
        $title = wtk_txt_center(mb_strtoupper($title), $_width) . "\n";
    } else {
        $title = $_indent . ' ' . $title;
    }
    echo $title;
    ?>


<?php 
}
wtk_txt_children_data($this, $_indent, $_width);
$this->outputChildren();
echo "\n";
示例#2
0
if ($show_header) {
    $cells = array();
    $j = 0;
    foreach ($columns as $col) {
        $cells[] = wtk_txt_center($col->getTitle(), $largeurs[$j], true);
        $j++;
    }
    echo $_indent . implode(' | ', $cells) . "\n";
    echo $_indent . wtk_txt_pad('', array_sum($largeurs) + 3 * (count($largeurs) - 1), '—') . "\n";
}
for ($i = 0; $i < $rows; $i++) {
    $cells = array();
    for ($j = 0; $j < $cols; $j++) {
        $id = 'cell-' . $i . '-' . $j;
        wtk_txt_data($this->{$id}, '', $largeurs[$j]);
        $td = $this->{$id}->render();
        $cells[] = explode("\n", $td);
    }
    for ($k = 0; $k < $hauteurs[$i]; $k++) {
        $cs = array();
        for ($j = 0; $j < $cols; $j++) {
            $td = isset($cells[$j][$k]) ? $cells[$j][$k] : "";
            $cs[] = wtk_txt_pad($td, $largeurs[$j]);
        }
        echo $_indent . implode(' | ', $cs) . "\n";
    }
}
$table = ob_get_contents();
ob_end_clean();
echo wtk_txt_center($table, $_width);