Browse Source

Widget 'yii\authclient\widgets\Choice' renamed to 'yii\authclient\widgets\AuthChoice'

tags/2.0.0-beta
Klimov Paul 11 years ago
parent
commit
7f0ab92d8e
  1. 18
      extensions/authclient/widgets/AuthChoice.php
  2. 4
      extensions/authclient/widgets/AuthChoiceAsset.php

18
extensions/authclient/widgets/Choice.php → extensions/authclient/widgets/AuthChoice.php

@ -14,7 +14,7 @@ use yii\helpers\Html;
use yii\authclient\ClientInterface;
/**
* Choice prints buttons for authentication via various auth clients.
* AuthChoice prints buttons for authentication via various auth clients.
* It opens a popup window for the client authentication process.
* By default this widget relies on presence of [[\yii\authclient\Collection]] among application components
* to get auth clients information.
@ -22,7 +22,7 @@ use yii\authclient\ClientInterface;
* Example:
*
* ~~~php
* <?= yii\authclient\widgets\Choice::widget([
* <?= yii\authclient\widgets\AuthChoice::widget([
* 'baseAuthUrl' => ['site/auth']
* ]); ?>
* ~~~
@ -33,17 +33,17 @@ use yii\authclient\ClientInterface;
*
* ~~~php
* <?php
* use yii\authclient\widgets\Choice;
* use yii\authclient\widgets\AuthChoice;
* ?>
* <?php $authChoice = Choice::begin([
* <?php $authAuthChoice = AuthChoice::begin([
* 'baseAuthUrl' => ['site/auth']
* ]); ?>
* <ul>
* <?php foreach ($authChoice->getClients() as $client): ?>
* <li><?= $authChoice->clientLink($client) ?></li>
* <?php foreach ($authAuthChoice->getClients() as $client): ?>
* <li><?= $authAuthChoice->clientLink($client) ?></li>
* <?php endforeach; ?>
* </ul>
* <?php Choice::end(); ?>
* <?php AuthChoice::end(); ?>
* ~~~
*
* This widget supports following keys for [[ClientInterface::getViewOptions()]] result:
@ -58,7 +58,7 @@ use yii\authclient\ClientInterface;
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
*/
class Choice extends Widget
class AuthChoice extends Widget
{
/**
* @var string name of the auth client collection application component.
@ -226,7 +226,7 @@ class Choice extends Widget
{
if ($this->popupMode) {
$view = Yii::$app->getView();
ChoiceAsset::register($view);
AuthChoiceAsset::register($view);
$view->registerJs("\$('#" . $this->getId() . "').authchoice();");
}
$this->options['id'] = $this->getId();

4
extensions/authclient/widgets/ChoiceAsset.php → extensions/authclient/widgets/AuthChoiceAsset.php

@ -10,12 +10,12 @@ namespace yii\authclient\widgets;
use yii\web\AssetBundle;
/**
* ChoiceAsset is an asset bundle for [[Choice]] widget.
* AuthChoiceAsset is an asset bundle for [[AuthChoice]] widget.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
*/
class ChoiceAsset extends AssetBundle
class AuthChoiceAsset extends AssetBundle
{
public $sourcePath = '@yii/authclient/widgets/assets';
public $js = [
Loading…
Cancel
Save