public function beforeSave($insert) { if (parent::beforeSave($insert)) { $this->roli = SqlArray::encode($this->roliAsArray, \app\enums2\Rol::className()); return true; } else { return false; } }
?> <?php echo $form->field($model, 'rabotaEtapObrazovaniya')->widget(Select2::className(), ['data' => EtapObrazovaniya::namesMap()]); ?> <?php echo $form->field($model, 'rabotaTelefon')->widget(MaskedInput::className(), ['mask' => '+79999999999']); ?> <div class="fields-group-heading"> <h3>Роли пользователя в системе</h3> </div> <?php echo $form->field($model, 'roli')->widget(Select2::classname(), ['data' => Rol::names(), 'options' => ['multiple' => true, 'placeholder' => 'Выберите роль ...']]); ?> </div> </div> <div class="row"> <div class="col-md-10 col-md-offset-1"> <div class="fields-group-heading"></div> <div class="row"> <div class="col-md-6 col-md-offset-3"> <?php echo Html::submitButton('Зарегистрировать', ['class' => 'btn btn-primary btn-block']); ?>