Guest User

Untitled

a guest
Jan 23rd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <?php
  2. namespace appbootstraps;
  3. use yiibaseBootstrapInterface;
  4.  
  5. class AppBootstrap implements BootstrapInterface{
  6.  
  7. public function bootstrap($app){
  8. $app->user->on(yiiwebUser::EVENT_BEFORE_LOGIN,['appmodelsuserUser', 'beforeLogin']);
  9. $app->user->on(yiiwebUser::EVENT_AFTER_LOGIN,['appmodelsuserUser', 'afterLogin']);
  10. $app->user->on(yiiwebUser::EVENT_BEFORE_LOGOUT,['appmodelsuserUser', 'beforeLogout']);
  11. }
  12. }
  13.  
  14. $config = [
  15. 'id' => 'basic',
  16. 'name' => 'x',
  17. 'basePath' => dirname(__DIR__),
  18. 'bootstrap' => [
  19. 'log',
  20. 'appbootstrapsAppBootstrap',
  21. ],
  22. .....etc
  23.  
  24. public function afterLogin($identity, $cookieBased, $duration){
  25. parent::afterLogin($identity, $cookieBased, $duration);
  26. // your code here, such set session
  27. }
Add Comment
Please, Sign In to add comment