Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace appbootstraps;
- use yiibaseBootstrapInterface;
- class AppBootstrap implements BootstrapInterface{
- public function bootstrap($app){
- $app->user->on(yiiwebUser::EVENT_BEFORE_LOGIN,['appmodelsuserUser', 'beforeLogin']);
- $app->user->on(yiiwebUser::EVENT_AFTER_LOGIN,['appmodelsuserUser', 'afterLogin']);
- $app->user->on(yiiwebUser::EVENT_BEFORE_LOGOUT,['appmodelsuserUser', 'beforeLogout']);
- }
- }
- $config = [
- 'id' => 'basic',
- 'name' => 'x',
- 'basePath' => dirname(__DIR__),
- 'bootstrap' => [
- 'log',
- 'appbootstrapsAppBootstrap',
- ],
- .....etc
- public function afterLogin($identity, $cookieBased, $duration){
- parent::afterLogin($identity, $cookieBased, $duration);
- // your code here, such set session
- }
Add Comment
Please, Sign In to add comment