通过Facebook登录时呈现视图

时间:2016-10-24 10:34:17

标签: php facebook yii2

我想通过last_name小部件登录我的网站时向用户显示Facebookpublic function actions() { return [ 'auth' => [ 'class' => 'yii\authclient\AuthAction', 'successCallback' => [$this, 'oAuthSuccess'], ], ]; } public function oAuthSuccess($client) { // get user data from client $userAttributes = $client->getUserAttributes(); return $this->render('say', [ 'first_name' => $userAttributes['first_name'], 'last_name' => $userAttributes['last_name'], ]); // do some thing with user data. for example with $userAttributes['email'] } 。但是,当我没有记录任何事情时,我只看到我的索引页面。

我的控制器:

<?php
use yii\helpers\Html;
?>
<?= Html::encode($first_name) ?>
<?= Html::encode($last_name) ?>

我的观点say.php:

<b>

0 个答案:

没有答案