Use radio buttons to select
Demo of Illustrated
Note: as this is a demo, you can't really upload files. However, you can browse for images on your system and test the Uploader widget.
By setting the option radio
in the Uploader widget the aspect ratio is selectable through radio buttons as opposed to a dropdown list.
The other options of the Uploader widget are exactly the same as in this demo.
Data in the database
Click on the thumbnail to see examples of img file(s) on the server.
Settings of the Uploader widget
<?php use sjaakp\illustrated\Uploader; ?> <?php $form = ActiveForm::begin([ 'options' => ['enctype' => 'multipart/form-data'] // important, needed for file upload ]); ?> ... // other form fields <?= $form->field($model, 'img')->widget(Uploader::class, [ 'aspectOptions' => [ 429 => 'tower (9x21)', 563 => 'high (9x16)', 750 => 'portrait (3x4)', 1000 => 'square (1x1)', 1333 => 'landscape (4x3)', 1778 => 'wide (16x9)', 2333 => 'cinema (21x9)', ], 'defaultAspect' => 1.0, 'radio' => true, 'deleteOptions' => false ]) ?> ... <?php ActiveForm::end(); ?>