Overview

Namespaces

  • Core
    • BaseClasses
    • Cookie
    • Crontab
    • DB
    • Input
    • Mailer
    • Middleware
      • Auth
      • CSRF
    • Route
    • Session
    • System
  • None

Classes

  • Bridge
  • Core\BaseClasses\BaseAuth
  • Core\BaseClasses\BaseController
  • Core\BaseClasses\BaseCSRF
  • Core\Cookie\Cookie
  • Core\Crontab\Crontab
  • Core\DB\DB
  • Core\Input\Input
  • Core\Mailer\Mailer
  • Core\Middleware\Auth\Auth
  • Core\Middleware\CSRF\CSRF
  • Core\Route\Route
  • Core\Session\Session
  • Core\System\System

Functions

  • back
  • ControllerAutoload
  • dbd
  • ErrorHandler
  • ExceptionHandler
  • json
  • loadConfig
  • MiddlewareAutoload
  • redirect
  • SPAutoload
  • view
  • Overview
  • Namespace
  • Class
  1: <?php
  2: /**
  3:  * Created by PhpStorm.
  4:  * @Author : Shakti Phartiyal
  5:  * Date: 11/28/16
  6:  * Time: 2:05 PM
  7:  */
  8: namespace Core\Route;
  9: 
 10: class Route
 11: {
 12:     protected static $URLS = array();
 13: 
 14:     /**
 15:      * Handle GET Request
 16:      * @param $path
 17:      * @param $classedFunction
 18:      */
 19:     public static function get($path, $classedFunction)
 20:     {
 21:         self::$URLS['GET'][$path]=$classedFunction;
 22:     }
 23: 
 24:     /**
 25:      * Handle POST Request
 26:      * @param $path
 27:      * @param $classedFunction
 28:      */
 29:     public static function post($path, $classedFunction)
 30:     {
 31:         self::$URLS['POST'][$path]=$classedFunction;
 32:     }
 33: 
 34:     /**
 35:      * Handle PUT request
 36:      * @param $path
 37:      * @param $classedFunction
 38:      */
 39:     public static function put($path, $classedFunction)
 40:     {
 41:         self::$URLS['PUT'][$path]=$classedFunction;
 42:     }
 43: 
 44:     /**
 45:      * Handle patch REQUEST
 46:      * @param $path
 47:      * @param $classedFunction
 48:      */
 49:     public static function patch($path, $classedFunction)
 50:     {
 51:         self::$URLS['PATCH'][$path]=$classedFunction;
 52:     }
 53: 
 54:     /**
 55:      * Handle DELETE request
 56:      * @param $path
 57:      * @param $classedFunction
 58:      */
 59:     public static function delete($path, $classedFunction)
 60:     {
 61:         self::$URLS['DELETE'][$path]=$classedFunction;
 62:     }
 63: 
 64:     /**
 65:      * Handle HEAD request
 66:      * @param $path
 67:      * @param $classedFunction
 68:      */
 69:     public static function head($path, $classedFunction)
 70:     {
 71:         self::$URLS['HEAD'][$path]=$classedFunction;
 72:     }
 73: 
 74:     /**
 75:      * Handle OPTIONS request
 76:      * @param $path
 77:      * @param $classedFunction
 78:      */
 79:     public static function options($path, $classedFunction)
 80:     {
 81:         self::$URLS['OPTIONS'][$path]=$classedFunction;
 82:     }
 83: 
 84:     /**
 85:      * Handle any request method
 86:      * @param $path
 87:      * @param $classedFunction
 88:      */
 89:     public static function any($path, $classedFunction)
 90:     {
 91:         self::get($path,$classedFunction);
 92:         self::post($path,$classedFunction);
 93:         self::put($path,$classedFunction);
 94:         self::patch($path,$classedFunction);
 95:         self::delete($path,$classedFunction);
 96:         self::head($path,$classedFunction);
 97:         self::options($path,$classedFunction);
 98:     }
 99: }
100: 
API documentation generated by ApiGen