diff --git a/src/Tqdev/PhpCrudApi/Api.php b/src/Tqdev/PhpCrudApi/Api.php index bb29206e..08c07867 100644 --- a/src/Tqdev/PhpCrudApi/Api.php +++ b/src/Tqdev/PhpCrudApi/Api.php @@ -119,6 +119,16 @@ public function __construct(Config $config) $geoJson = new GeoJsonService($reflection, $records); new GeoJsonController($router, $responder, $geoJson); break; + default: + $controllerChunks = explode(':', $controller); + if (count($controllerChunks) === 2 && $controllerChunks[0] === 'custom') { + $className = $controllerChunks[1]; + if (class_exists($className)) { + $records = new RecordService($db, $reflection); + new $className($router, $responder, $records); + } + } + break; } } $this->router = $router; diff --git a/src/Tqdev/PhpCrudApi/Controller/CustomController.php b/src/Tqdev/PhpCrudApi/Controller/CustomController.php new file mode 100644 index 00000000..59005a6d --- /dev/null +++ b/src/Tqdev/PhpCrudApi/Controller/CustomController.php @@ -0,0 +1,23 @@ +registerRoutes($router); + + $this->service = $service; + $this->responder = $responder; + } + + protected function registerRoutes(Router $router) + { + } +}