panx framework | Documentation | API Endpoint

API Endpoint

You can create API endpoint on API route's version, e.g. on v1 or v2. As second parameter, you need to use handler class reference (e.g. new API()). That means, if the user will request /api/v1/display, the request will be handled by the registered handler. The Route engine will call request() function of that registered handler, which will return true of false. If returns true, the execution of script will continue and will include all files as normal, but if it returns false, the Route engine will call error() function of registered handler. You can see example handler class - API Class.

array(3) { [0]=> string(20) "docs/v0.3/header.php" [1]=> string(27) "docs/v0.3/api-endpoints.php" [2]=> string(20) "docs/v0.3/footer.php" }