M
M
Morrowind2019-02-04 10:51:11
Yii
Morrowind, 2019-02-04 10:51:11

Why is Yii2 file kit not indexing correctly?

The bottom line is this: I upload files via https://github.com/yii2-starter-kit/yii2-file-kit The output is that it loads all the files, but I can’t save them because the indexes for the inputs are not put down greater than 1.
Tvv8e.png
As you can see. image[0]and two image[1]
Upload 100 files - the first one will be with index 0, and the rest with 1.
Widget code:

<?php echo $form->field($model, 'images')->widget(
        \trntv\filekit\widget\Upload::class,
    [
        'url' => ['/file/storage/upload'], 
        'maxNumberOfFiles' => 10,
    ]
    ); ?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2019-02-04
@webinar

'maxNumberOfFiles' => 2 // default 1,

P
Pavel, 2019-02-04
@PavelMonro

See documentation for Upload Widget
Parameter: 'maxNumberOfFiles' => 3 // default 1,

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question