Okay.
Hier mal ein Vorschlag:
<?php
$fulluri=$_SERVER['REQUEST_URI'];
$uri_params=explode("?",$fulluri);
$uri=trim($uri_params[0], '/');
$uri=explode("/",$uri);
$controller="Controllers_".$uri[0];
$object=new $controller();
$paramstring = $uri_params[1] ;
$params=explode("&",$paramstring);
$object->$uri[1]( $params);
?>
Hast du dir das so vorgestellt ca?
Ich hoffe das ist okay so. Sag mal was man da noch besser machen könnte, irgendeine Sicherheitslücke?
Also ich habs mal ausgeben lassen indem ich folgendes gemacht habe:
echo "Controller: ".$uri[0]."<br> ";
echo "Action: ".$uri[1]."<br> ";
var_dump($params);
Bei dieser URL:
http://localhost/controller/action/?parameter=2&klappt=true
kommt folgende Ausgabe:
Controller: controller
Action: action
array(2) { [0]=> string(11) "parameter=2" [1]=> string(11) "klappt=true" }
Also klappt =).
Danke für deine bisherige Hilfe,
Klaus