PHP Classes

File: router.php

Recommend this page to a friend!
  Classes of Brett Dutton   JackBooted PHP Framework   router.php   Download  
File: router.php
Role: Example script
Content type: text/plain
Description: Example script
Class: JackBooted PHP Framework
Web application framework using simplified MVC
Author: By
Last change:
Date: 8 years ago
Size: 526 bytes
 

Contents

Class file image Download
<?php
require_once dirname ( __FILE__ ) . '/config.php';

$requestURI = $_SERVER['REQUEST_URI'];
$requestMethod = $_SERVER['REQUEST_METHOD'];

switch (
$requestMethod ) {
    case
'GET':
        if (
$requestURI == '/api/Ping' ) {
            echo \
App\Mocks\APIPing::index();
            exit;
        }

    case
'POST':
        switch (
$requestURI ) {
            case
'/api/Ping':
                echo \
App\Mocks\APIPing::index();
                exit;
        }
}

echo
"Unknown $requestMethod Request: $requestURI";