mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Updated documentation and added demo-project.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace Demo\Controllers;
|
||||
|
||||
use Pecee\Http\Request;
|
||||
|
||||
class ApiController {
|
||||
|
||||
public function index() {
|
||||
|
||||
// The variable authenticated is set to true in the ApiVerification middleware class.
|
||||
|
||||
$request = Request::getInstance();
|
||||
|
||||
header('content-type: application/json');
|
||||
|
||||
echo json_encode([
|
||||
'authenticated' => $request->authenticated
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user