/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/views/elem/_switchery.php
20 строк
591 B
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php /** * switchery */ use yii\bootstrap\ActiveForm; /** @var $form ActiveForm */ /** @var $name string */ /** @var $model common\models\base\BaseModel */ /** @var $options [] */ $class = "checkbox checkbox-switchery " . \yii\helpers\ArrayHelper::getValue($options, 'class'); $options['template'] = "{beginWrapper}\n<div class=\"" . $class . "\">\n{beginLabel}\n{input}\n{labelTitle}\n{endLabel}\n</div>\n{error}\n{hint}\n{endWrapper}"; $options['class'] = 'switchery'; $options['label'] = $model->getAttributeLabel($name); echo $form->field($model, $name) ->checkbox($options);