Advertisement
juliarnasution

pemanggilan helper

Mar 11th, 2018
703
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. //fungsi hapus pada file UserController
  2. public function hapus()
  3.     {
  4.         $id = $this->uri->segment(3);
  5.         $where = array('id'=>$id);
  6.         $hapus = $this->SistemModel->hapus('users',$where); //code ini untuk menghapus data user
  7.         if ($hapus) {//jika proses hapus berhasil
  8.             $this->session->set_flashdata('notif', notifikasi(TRUE));
  9. // notifikasi(TRUE), notifikasi()  adalah fungsi helper yang sedang di panggil, sedangkan TRUE adalah parameter fungsi
  10.         }else{ //jika proses hapus gagal
  11.             $this->session->set_flashdata('notif', notifikasi(FALSE));
  12. // notifikasi(FALSE), notifikasi()  adalah fungsi helper yang sedang di panggil, sedangkan FALSEadalah parameter fungsi
  13.         }
  14.         redirect('user/index','refresh');
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement