dev:yii

Yii PHP Framework

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]) ?>
AssetBundle
/**
* @var array
*/
public $publishOptions = [
'forceCopy' => true
];
  • awesome-yii – curated list of Yii2 resources
  • Yii Gist – Yii framework and extension/package catalog
  • Last modified: 2024-07-05 14:31