Added clasess support for routes

This commit is contained in:
absurdo 2023-10-25 15:24:09 +02:00
parent 1ef52579a3
commit a6a95e0027
2 changed files with 59 additions and 1 deletions

View file

@ -0,0 +1,35 @@
<?php
class AppController {
public function App($switch) {
switch($switch) {
default:
return 'Welcome to the real world in class App!';
break;
case 'good':
return 'All things are good in class App!';
break;
case 'json':
$data=['data' => 'Cool'];
header('Content-Type: application/json; charset=utf-8');
return json_encode($data);
break;
}
}
}