PHP Classes

File: include/autoload.php

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Simple REST API   include/autoload.php   Download  
File: include/autoload.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: Simple REST API
Example of REST API using the MVC design pattern
Author: By
Last change:
Date: 27 days ago
Size: 505 bytes
 

Contents

Class file image Download
<?php
   
//Fix cross Origin
   
header('Access-Control-Allow-Origin: *');
   
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
   
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, X-Requested-With");

   
spl_autoload_register("loadclass");
   
    function
loadclass($classname)
    {
       
$path = "Class/";
       
$extention = ".php";
       
$fullpath = $path.$classname.$extention;

        include
$fullpath;
    }

?>