Advertisement
lamhottt

Controller Login

Aug 11th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. use System\GF_Router;
  2.  
  3.  
  4. /*
  5. * Contoh menggunakan Controller
  6. * Gunakan halaman controller ini untuk membuat session dan cookie user
  7. * dan selalu gunakan extends GF_Router
  8. */
  9. class User_Controller extends GF_Router
  10. {
  11.    
  12.     public function checkLogin()
  13.     {
  14.         // check session username
  15.         if (_checkSession('username'))
  16.         {
  17.             // jika ada, maka alihkan ke view welcome
  18.             self::setView("welcome");
  19.             exit;
  20.         }
  21.     }
  22.    
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement