Commit 7f0ab92d by Klimov Paul

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

parent c7a22272
...@@ -14,7 +14,7 @@ use yii\helpers\Html; ...@@ -14,7 +14,7 @@ use yii\helpers\Html;
use yii\authclient\ClientInterface; 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. * It opens a popup window for the client authentication process.
* By default this widget relies on presence of [[\yii\authclient\Collection]] among application components * By default this widget relies on presence of [[\yii\authclient\Collection]] among application components
* to get auth clients information. * to get auth clients information.
...@@ -22,7 +22,7 @@ use yii\authclient\ClientInterface; ...@@ -22,7 +22,7 @@ use yii\authclient\ClientInterface;
* Example: * Example:
* *
* ~~~php * ~~~php
* <?= yii\authclient\widgets\Choice::widget([ * <?= yii\authclient\widgets\AuthChoice::widget([
* 'baseAuthUrl' => ['site/auth'] * 'baseAuthUrl' => ['site/auth']
* ]); ?> * ]); ?>
* ~~~ * ~~~
...@@ -33,17 +33,17 @@ use yii\authclient\ClientInterface; ...@@ -33,17 +33,17 @@ use yii\authclient\ClientInterface;
* *
* ~~~php * ~~~php
* <?php * <?php
* use yii\authclient\widgets\Choice; * use yii\authclient\widgets\AuthChoice;
* ?> * ?>
* <?php $authChoice = Choice::begin([ * <?php $authAuthChoice = AuthChoice::begin([
* 'baseAuthUrl' => ['site/auth'] * 'baseAuthUrl' => ['site/auth']
* ]); ?> * ]); ?>
* <ul> * <ul>
* <?php foreach ($authChoice->getClients() as $client): ?> * <?php foreach ($authAuthChoice->getClients() as $client): ?>
* <li><?= $authChoice->clientLink($client) ?></li> * <li><?= $authAuthChoice->clientLink($client) ?></li>
* <?php endforeach; ?> * <?php endforeach; ?>
* </ul> * </ul>
* <?php Choice::end(); ?> * <?php AuthChoice::end(); ?>
* ~~~ * ~~~
* *
* This widget supports following keys for [[ClientInterface::getViewOptions()]] result: * This widget supports following keys for [[ClientInterface::getViewOptions()]] result:
...@@ -58,7 +58,7 @@ use yii\authclient\ClientInterface; ...@@ -58,7 +58,7 @@ use yii\authclient\ClientInterface;
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0
*/ */
class Choice extends Widget class AuthChoice extends Widget
{ {
/** /**
* @var string name of the auth client collection application component. * @var string name of the auth client collection application component.
...@@ -226,7 +226,7 @@ class Choice extends Widget ...@@ -226,7 +226,7 @@ class Choice extends Widget
{ {
if ($this->popupMode) { if ($this->popupMode) {
$view = Yii::$app->getView(); $view = Yii::$app->getView();
ChoiceAsset::register($view); AuthChoiceAsset::register($view);
$view->registerJs("\$('#" . $this->getId() . "').authchoice();"); $view->registerJs("\$('#" . $this->getId() . "').authchoice();");
} }
$this->options['id'] = $this->getId(); $this->options['id'] = $this->getId();
......
...@@ -10,12 +10,12 @@ namespace yii\authclient\widgets; ...@@ -10,12 +10,12 @@ namespace yii\authclient\widgets;
use yii\web\AssetBundle; 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> * @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0 * @since 2.0
*/ */
class ChoiceAsset extends AssetBundle class AuthChoiceAsset extends AssetBundle
{ {
public $sourcePath = '@yii/authclient/widgets/assets'; public $sourcePath = '@yii/authclient/widgets/assets';
public $js = [ public $js = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment