Example #1
0
                continue;
            }
            /*	Es kann passieren, dass ein Modul 2x auf einer Seite geladen wird,
            				deshalb wird es nur inkludiert, wenn die Klasse für das Modul
            				noch nicht existiert
            			*/
            if (!class_exists($module["class"])) {
                include MOD_DIR . $module["file"];
            }
            /* Ausgabe unterdrücken */
            ob_start();
            $content = new $module["class"]();
            /* Instanz von der Modulklasse laden */
            $content->database = $this->database;
            /* Datenbankobjekt übergeben ans Modul ---- TODO ----- */
            $content->Run();
            /* Modul ausführen */
            $this->{$module["name"]} .= ob_get_contents();
            /* Ausgaben an den Platzhalten hinzufügen */
            ob_end_clean();
            /* Ausgabenpuffer löschen */
        }
    }
}
$id = isset($_GET["id"]) ? ctype_digit($_GET["id"]) ? $_GET["id"] : 1 : "1";
$template = new Template();
$template->database = new database("mysql", "localhost", "root", "passwort", "rockboard", true);
# bestens
$template->setContentFromDatabase($id);
$template->Load("testTemplate.php");
/* Danke */