Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- // import library dari REST_Controller
- require APPPATH . 'libraries/REST_Controller.php';
- class Api_Connection extends REST_Controller {
- public function __construct(){
- parent::__construct();
- $this->load->model('api_m','api');
- }
- public function index_get()
- {
- // testing response
- $response['status'] = 200;
- $response['error'] = false;
- $response['message'] = 'Selamat datang insan muda, masuklah dengan Assalamu alaikum wr.wb';
- // tampilkan response
- $this->response($response);
- }
- public function monitoring_get(){
- $data = $this->api->api_monitoring();
- if ($data->num_rows() > 0) {
- $data = $data->result();
- }else{
- $data = null;
- }
- //tampilkan response
- $this->response($data);
- }
- }
- /* End of file Api_Connection.php */
- /* Location: ./application/controllers/Api_Connection.php */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement