How to display file size and additional buttons in the widget Kartik-v YII2 FileInput?

I can not get this result:
cc365055dd7a4451a57948137b596fad.png
Ie need to display a button drag the button to open preview and file size.
In the first demo , everything works out of the box, no extra settings, the author does not - and everything works "as it should".
In fact, it turns out:
94189dcb3712488b9a8191ca1968994f.png
I think it's in the templates. Trying to change the template to:
'layoutTemplates' => [
 'size' => '<span>{sizeText}</span>',
 'footer' => '<div class="file-thumbnail-footer">
 <div class="file-caption-name" style="width:{width}">{caption}{size}</div>
 {progress} {actions}
</div>',
],

And get this:
241cc40813924e779aceb21760e78add.png
The uploading of pictures goes with a Bang, left to do "beauty", but something I can not understand CANT?
July 8th 19 at 16:46
1 answer
July 8th 19 at 16:48
Solution
Here everything is painted in detail: demos.krajee.com/widget-details/fileinput
Specifically size :
echo FileInput::widget([
 'name' => 'attachment_49[]',
'options'=>[
'multiple'=>true
],
 'pluginOptions' => [
'initialPreview'=>[
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/FullMoon2010.jpg/631px-FullMoon2010.jpg",
"http://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/Earth_Eastern_Hemisphere.jpg/600px-Earth_Eastern_Hemisphere.jpg"
],
'initialPreviewAsData'=>true,
 'initialCaption'=>"The Moon and the Earth",
 'initialPreviewConfig' => [
 ['caption' => 'Moon.jpg', 'size' => '873727'],
 ['caption' => 'Earth.jpg', 'size' => '1287883'],
],
'overwriteInitial'=>false,
'maxFileSize'=>2800
]
]);
My example for a php widget, not for js code, theoretically it can generate js from Your. It is necessary to disassemble the widget and watch. Yes, it is wraper to the bootstrap-fileinput ovskogo, but not the fact that there's no additional dependencies, same structure and same whether version. - Henderson_Beat commented on July 8th 19 at 16:57
Yes, in that case, I have tried php and js versions, I can not achieve a result as the author of the demos. - grady.Nad commented on July 8th 19 at 17:00
Here plugins.krajee.com/file-basic-usage-demo#basic-exa... when you insert a new file showing the file size and zoom button. Moreover, no additional configuration is specified. And here I mimic the default settings: codepen.io/anon/pen/KMpbVb, and as you can see neither the size nor zoom no. The problem is, will not prompt? - grady.Nad commented on July 8th 19 at 16:51
Here's your example codepen.io/anon/pen/KMpbVb?editors=1010, generally not working as expected. What's wrong, I can not understand. Anywhere there is no adequate explanation. - grady.Nad commented on July 8th 19 at 16:54
: Yes, there's a weird docks. Usually use (like fileinput) or mega easy solution https://github.com/2amigos/yii2-file-upload-widget either www.dropzonejs.com - Henderson_Beat commented on July 8th 19 at 17:03

Find more questions by tags Yii