<?php class FrontController { private $action; private function __construct() { $this->requests['get'] = $_GET; $this->requests['post'] = $_POST; $this->action = $this->requests['get']['ac']; foreach($this->requests['get'] as $key => $val) { if($key == "ac") continue; $action_parameters[$key] = $val; } } $controller = new FrontController(); } return $controller; } public function Dispatch() { $funcName = '$this' . 'Action' . $this->action; } public function Action00() { } } ?>
Nie wiem tylko jak sprawdzić, czy funkcję Action00 da się wykonać (patrz przedostatnia linijka funkcji Dispatch)