PHP Class yii\authclient\widgets\AuthChoice

It opens a popup window for the client authentication process. By default this widget relies on presence of Collection among application components to get auth clients information. Example: php ['site/auth'] ]); ?> You can customize the widget appearance by using [[begin()]] and [[end()]] syntax along with using method AuthChoice::clientLink or AuthChoice::createClientUrl. For example: php ['site/auth'] ]); ?>
    getClients() as $client): ?>
  • clientLink($client) ?>
This widget supports following keys for [[ClientInterface::getViewOptions()]] result: - popupWidth: int, width of the popup window in pixels. - popupHeight: int, height of the popup window in pixels. - widget: array, configuration for the widget, which should be used to render a client link; such widget should be a subclass of [[AuthChoiceItem]].
See also: yii\authclient\AuthAction
Since: 2.0
Author: Paul Klimov ([email protected])
Inheritance: extends yii\base\Widget
Afficher le fichier Open project: yiisoft/yii2-authclient Class Usage Examples

Méthodes publiques

Свойство Type Description
$autoRender indicates if widget content, should be rendered automatically. Note: this value automatically set to 'false' at the first call of AuthChoice::createClientUrl
$clientCollection name of the auth client collection application component. This component will be used to fetch services value if it is not set.
$clientIdGetParamName name of the GET param , which should be used to passed auth client id to URL defined by [[baseAuthUrl]].
$clientOptions additional options to be passed to the underlying JS plugin.
$options the HTML attributes that should be rendered in the div HTML tag representing the container element.
$popupMode indicates if popup window should be used instead of direct links.

Méthodes publiques

Méthode Description
clientLink ( yii\authclient\ClientInterface $client, string $text = null, array $htmlOptions = [] ) : string Outputs client auth link.
createClientUrl ( yii\authclient\ClientInterface $client ) : string Composes client auth URL.
getBaseAuthUrl ( ) : array
getClients ( ) : yii\authclient\ClientInterface[]
init ( ) Initializes the widget.
run ( ) : string Runs the widget.
setBaseAuthUrl ( array $baseAuthUrl )
setClients ( array $clients )

Méthodes protégées

Méthode Description
defaultBaseAuthUrl ( ) : array Composes default base auth URL configuration.
defaultClients ( ) : yii\authclient\ClientInterface[] Returns default auth clients list.
renderMainContent ( ) : string Renders the main content, which includes all external services links.

Method Details

createClientUrl() public méthode

Composes client auth URL.
public createClientUrl ( yii\authclient\ClientInterface $client ) : string
$client yii\authclient\ClientInterface external auth client instance.
Résultat string auth URL.

defaultBaseAuthUrl() protected méthode

Composes default base auth URL configuration.
protected defaultBaseAuthUrl ( ) : array
Résultat array base auth URL configuration.

defaultClients() protected méthode

Returns default auth clients list.
protected defaultClients ( ) : yii\authclient\ClientInterface[]
Résultat yii\authclient\ClientInterface[] auth clients list.

getBaseAuthUrl() public méthode

public getBaseAuthUrl ( ) : array
Résultat array base auth URL configuration.

getClients() public méthode

public getClients ( ) : yii\authclient\ClientInterface[]
Résultat yii\authclient\ClientInterface[] auth providers

init() public méthode

Initializes the widget.
public init ( )

renderMainContent() protected méthode

Renders the main content, which includes all external services links.
protected renderMainContent ( ) : string
Résultat string generated HTML.

run() public méthode

Runs the widget.
public run ( ) : string
Résultat string rendered HTML.

setBaseAuthUrl() public méthode

public setBaseAuthUrl ( array $baseAuthUrl )
$baseAuthUrl array base auth URL configuration.

setClients() public méthode

public setClients ( array $clients )
$clients array auth providers

Property Details

$autoRender public_oe property

indicates if widget content, should be rendered automatically. Note: this value automatically set to 'false' at the first call of AuthChoice::createClientUrl
public $autoRender

$clientCollection public_oe property

name of the auth client collection application component. This component will be used to fetch services value if it is not set.
public $clientCollection

$clientIdGetParamName public_oe property

name of the GET param , which should be used to passed auth client id to URL defined by [[baseAuthUrl]].
public $clientIdGetParamName

$clientOptions public_oe property

additional options to be passed to the underlying JS plugin.
public $clientOptions

$options public_oe property

the HTML attributes that should be rendered in the div HTML tag representing the container element.
See also: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $options

$popupMode public_oe property

indicates if popup window should be used instead of direct links.
public $popupMode