I am trying to customize AuthChoice with begin and end as mentioned in the Authchoice.php documentation.
I wanted to render the below button foreach client
Html::a( 'Log in with '. $client->title, ['site/auth', 'authclient'=> $client->name, ], ['class' => "btn btn-block btn-default $client->name "])
But AuthChoice is displaying the default buttons/clients also.
Solved by setting the below property
'autoRender' => false
Thanks Venu85 this solved my problem. Just for a people new to yii2 (like me) the code snippet looks like below (add it to your view page)
<?php use yii\authclient\widgets\AuthChoice; ?>
<?php $authAuthChoice = AuthChoice::begin(['baseAuthUrl' => ['site/auth'], 'autoRender' => false]); ?>
<ul>
<?php foreach ($authAuthChoice->getClients() as $client): ?>
<li><?= Html::a( 'Log in with '. $client->title, ['site/auth', 'authclient'=> $client->name, ], ['class' => "btn btn-block btn-default $client->name "]) ?></li>
<?php endforeach; ?>
</ul>
<?php AuthChoice::end(); ?>
How can I open the same in default dialog box with customized widget.
Most helpful comment
Thanks Venu85 this solved my problem. Just for a people new to yii2 (like me) the code snippet looks like below (add it to your view page)