Advertisement
gundambison

perbaikan 80-coba rest

Aug 28th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.83 KB | None | 0 0
  1. <?php
  2.  
  3. defined('BASEPATH') OR exit('No direct script access allowed');
  4. //===========extend core REST=========
  5. require_once APPPATH . '/libraries/REST_Controller.php';
  6. date_default_timezone_set('Asia/Jakarta');
  7.  
  8. class Core extends REST_Controller {
  9.  
  10.  
  11.     function __construct() {
  12.         parent::__construct();
  13.         header('Access-Control-Allow-Origin: *');
  14.  
  15.     }
  16.  
  17. function index_post(){
  18.     $this->test();
  19. }
  20.  
  21. function index_get(){
  22.     $this->test();
  23. }
  24.     private function test() {
  25.         $respon['raw'] = array();
  26.         $params = $this->post();
  27.         $respon['raw']['libs'] = $params;
  28.         $respon['raw']['apache'] = $_POST;
  29.         $respon['raw']['get'] = $_GET;
  30.         $respon['raw']['request'] = $_REQUEST;
  31.         $respon['raw']['server'] = $_SERVER;
  32.        
  33.  
  34.         $this->result($respon);
  35.     }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement