Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. public function actions()
  2. {
  3. return [
  4. 'auth' => [
  5. 'class' => 'yiiauthclientAuthAction',
  6. 'successCallback' => [$this, 'oAuthSuccess'],
  7. ],
  8. ];
  9. }
  10. public function oAuthSuccess($client) {
  11. // get user data from client
  12. $userAttributes = $client->getUserAttributes();
  13. return $this->render('say',['first_name' => $userAttributes['first_name'],'last_name' => $userAttributes['last_name'], ]);
  14. // do some thing with user data. for example with $userAttributes['email']
  15. }
  16.  
  17. <?php
  18. use yiihelpersHtml;
  19. ?>
  20. <?= Html::encode($first_name) ?>
  21. <?= Html::encode($last_name) ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement