class zaklad { public $db; function __construct() { $class = "baza"; $path = "{$class}.php"; throw new Exception("Brak pliku {$path}"); } require_once($path); if (!class_exists($class)) { throw new Exception("Brak klasy {$class}"); } $this->db = new baza(); } function getAllBets() { if ($this->db->connect()) { if ($results = $this->db->select("SELECT * FROM typer_main")) { 'text' => $row['Text'], 'res_x' => $row['Res_x'], 'res_y' => $row['Res_y'], 'kategoria' => $row['Kategoria'], 'data' => $row['Data'], 'status' => $row['Status'] ); } return $returned; } else { return false; } $this->db->close(); } else { return false; } } function showAllBets() { } }
jezeli wyswietlam tablice returned z metody getAllBets wszystko jest ok. Chcialbym jednak przekazac ją do metody show w celu formatowania jej wygladu. Jak mozna to zrobic ? Kod z pliku index:
$class = "zaklad"; $path = "{$class}.php"; require_once($path); } else { throw new Exception("Brak pliku {$path}"); } if (class_exists($class)) { $bet = new zaklad(); $bet->showAllBets(); }
Pozdrawiam