yii\authclient\widgets\AuthChoice::createClientUrl PHP Method

createClientUrl() public method

Composes client auth URL.
public createClientUrl ( yii\authclient\ClientInterface $client ) : string
$client yii\authclient\ClientInterface external auth client instance.
return string auth URL.
    public function createClientUrl($client)
    {
        $this->autoRender = false;
        $url = $this->getBaseAuthUrl();
        $url[$this->clientIdGetParamName] = $client->getId();
        return Url::to($url);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function createClientUrl($provider)
 {
     if ($this->isConnected($provider)) {
         return Url::to(['/user/setting/disconnect', 'id' => $this->accounts[$provider->getId()]->id]);
     } else {
         return parent::createClientUrl($provider);
     }
 }