Gii can generate models for you. If you want to generate a model for all database tables, enter *
for the database name.
<?php use yii\helpers\ArrayHelper; use kartik\select2\Select2; use app\models\YourModelYouWantToQuery; ?> … <?= $form->field($model, 'servicelevel_id')->widget(Select2::classname(), [ 'data' => ArrayHelper::map(YourModelYouWantToQuery::find()->all(),'servicelevel_id','servicelevel_id'), 'options' => ['placeholder' => 'Select a service level …'], 'pluginOptions' => [ 'allowClear' => true ], ]) ?>
<?= Html::activeInput('number', $model, 'attribute', ['class' => 'form-control small-width', 'step' => '0.1', 'min' => '0', 'value' => $value]) ?>
/** * @var array */ public $publishOptions = [ 'forceCopy' => true ];