/** * @inheritdoc */ public function init() { AuthChoiceAsset::register(\Yii::$app->view); if ($this->popupMode) { \Yii::$app->view->registerJs("\$('#" . $this->getId() . "').authchoice();"); } $this->options['id'] = $this->getId(); echo Html::beginTag('div', $this->options); }
/** * Initializes the widget. */ public function init() { $view = Yii::$app->getView(); if ($this->popupMode) { AuthChoiceAsset::register($view); if (empty($this->clientOptions)) { $options = ''; } else { $options = Json::htmlEncode($this->clientOptions); } $view->registerJs("\$('#" . $this->getId() . "').authchoice({$options});"); } else { AuthChoiceStyleAsset::register($view); } $this->options['id'] = $this->getId(); echo Html::beginTag('div', $this->options); }
<?php /** * @author Semenov Alexander <*****@*****.**> * @link http://skeeks.com/ * @copyright 2010 SkeekS (СкикС) * @date 25.03.2015 */ /* @var $this yii\web\View */ /* @var $model \skeeks\cms\models\forms\LoginFormUsernameOrEmail */ use yii\helpers\Html; use skeeks\cms\base\widgets\ActiveFormAjaxSubmit as ActiveForm; use skeeks\cms\helpers\UrlHelper; $this->title = $title; \Yii::$app->breadcrumbs->createBase()->append($this->title); \yii\authclient\widgets\AuthChoiceAsset::register($this); $this->registerCss(<<<CSS div.auth-clients { border-top: solid 1px #eee; margin: 0; padding: 0; text-align: center; padding-top: 10px; } ul.auth-clients { margin-bottom: 0; padding-bottom: 0; }
<?php use yii\authclient\widgets\AuthChoiceAsset; use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model app\models\User */ AuthChoiceAsset::register($this); $this->title = Yii::t('app', 'Update {modelClass}: ', ['modelClass' => 'User']) . ' ' . $model->name; $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Users'), 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'name' => $model->name]]; $this->params['breadcrumbs'][] = Yii::t('app', 'Update'); $socials = $model->socials; foreach ($socials as $name => $id) { if ($id) { unset($socials[$name]); } } $socials = array_keys($socials); ?> <div class="user-update"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo $this->render('_form', ['model' => $model]); ?> <?php