public static function create()
 {
     if (self::$_instance == null) {
         self::$_instance = new TableViewHelper();
     }
     return self::$_instance;
 }
示例#2
0
<?php

require_once '/../../ViewHelpers/TableViewHelper.php';
$rows = $_SESSION['temp'];
$count = 1;
echo "<h1>Ranking</h1>";
$table = TableViewHelper::create()->setTableAttributes(["padding-right" => "10px"]);
foreach ($rows as $row) {
    $table->addRow([$count, htmlspecialchars($row['username']), htmlspecialchars($row['Score'])]);
    $count++;
}
echo $table->render();
?>
<a href="/WebDevProject/public/home">Home</a>