aboutsummaryrefslogtreecommitdiff
path: root/controllers/meta.php
blob: e20bbfc4120c3cae23e78367ff8e42efcdaff2b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

function call_handler(string $name) {
    if (function_exists($name)) {
        call_user_func($name);
    }
}

switch ($_SERVER['REQUEST_METHOD']) {
    case 'POST': call_handler('Controller\on_post'); break;
    case 'PUT': call_handler('Controller\on_put'); break;
    case 'DELETE': call_handler('Controller\on_delete'); break;
};