Hallo Marc,
Nun die Frage, gibt es da nicht irgend eine elegantere Möglichkeit?
Ja. Du kannst Klassennamen auch in Variablen packen:
class Foo {
function hallo() { echo "Hallo Welt!\n"; }
}
$klassenname = 'Foo';
$objekt = new $klassenname;
$objekt->hallo();
Viele Grüße,
Christian
--
"I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone." - Bjarne Stroustrup
"I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone." - Bjarne Stroustrup