$m($arg); else $this->forward('index.php'); } public function __construct(&$db) { $this->db = $db; } public function forward($address) { header('Location: ' . $address); } public function loadView($view) { if (file_exists('./inc/views/'.$view.'.class.php') && !array_key_exists($view, $this->views)) { require_once('./inc/views/'.$view.'.class.php'); $this->views[$view] = new $view($this->db); } else { throw new Exception('Could not load selected view: '.$view); } } public function getView($view) { if (array_key_exists($view, $this->views)) return $this->views[$view]; else throw new Exception('Could not get selected view: '.$widok); } } ?>