public static function create() { if (self::$_instance == null) { self::$_instance = new TableViewHelper(); } return self::$_instance; }
<?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>