tipesdy.php 745 Bytes
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

require APPPATH.'/libraries/REST_Controller.php';
// use Restserver\Libraries\REST_Controller;

class Tipesdy extends REST_Controller {

    function __construct($config = 'rest') {
        parent::__construct($config);
        $this->load->database();
    }

    function index_get()
    {
        $this->db->select('rtid as tipe, tpname as deskripsi');
        $tipe = $this->db->get('resource_type')->result();
    	
        if($tipe)
        {
           $this->response($tipe, 200); // 200 being the HTTP response code
        }

        else
        {
            $this->response(array('error' => 'Jenis Sumberdaya could not be found'), 404);
        }
		
    }

}
?>