Show pagesourceBack to top Share via Share via... Twitter LinkedIn Telegram Yammer RedditRecent ChangesSend via e-MailPrintPermalink × Table of Contents Gii useful extensions widgets useful helpers Snippets Select2 with values from DB table input type with Html helper class always copy current vendor asset files in public dir further reading Documentation / Tutorials Yii PHP Framework Homepage Gii Gii can generate models for you. If you want to generate a model for all database tables, enter * for the database name. useful extensions Yii2 Migration Creator – automatically create migrations from existing database widgets Krajee Yii2 Widgets select2 Dynamic Forms useful helpers ArrayHelper Html Snippets Select2 with values from DB table <?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 ], ]) ?> input type with Html helper class <?= Html::activeInput('number', $model, 'attribute', ['class' => 'form-control small-width', 'step' => '0.1', 'min' => '0', 'value' => $value]) ?> always copy current vendor asset files in public dir AssetBundle /** * @var array */ public $publishOptions = [ 'forceCopy' => true ]; further reading awesome-yii – curated list of Yii2 resources Yii Gist – Yii framework and extension/package catalog Documentation / Tutorials Yii2 Lessons (YouTube / DoingITeasy) How to Program With Yii2 (envato tuts+) Advanced Multi Model Forms Last modified: 2019-12-20 14:21