view); if ($this->popupMode) { Yii::$app->view->registerJs("\$('#" . $this->getId() . "').authchoice();"); } $this->options['id'] = $this->getId(); echo Html::beginTag('div', $this->options); } /** * @inheritdoc */ public function createClientUrl($provider) { if ($this->isConnected($provider)) { return Url::to(['/user/settings/disconnect', 'id' => $this->accounts[$provider->getId()]->id]); } else { return parent::createClientUrl($provider); } } /** * Checks if provider already connected to user. * * @param ClientInterface $provider * * @return bool */ public function isConnected(ClientInterface $provider) { return $this->accounts != null && isset($this->accounts[$provider->getId()]); } }