Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function index_get(){
- $id = $this->get('id');
- if ($id === null) {
- $mahasiswa = $this->mahasiswa->getMahasiswa();
- }else{
- $query = "SELECT * FROM mahasiswa where id = 51";
- $mahasiswa = $this->mahasiswa->getMahasiswa($query);
- }
- if($mahasiswa){
- $this->response([
- 'status' => true,
- 'data' => $mahasiswa
- ], REST_Controller::HTTP_OK);
- }else{
- $this->response([
- 'status' => false,
- 'message' => 'id not found'
- ], REST_Controller::HTTP_NOT_FOUND);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement