Closed jokamax closed 5 years ago
I use otherActionButtons in my widget. {dataKey} no problem. {caption} no problem. But impossible to use {downloadUrl} => not replaced
My code :
$btns = '<button type="button" class="kv-cust-btn btn btn-default" title="Utiliser en tant qu\'avatar"{dataKey}>' . '<i class="fas fa-user-astronaut"></i>{downloadUrl}' . '</button>'; // your fileinput widget for single file upload echo $form->field($model, 'file')->widget(FileInput::classname(), [ 'options'=>['accept'=>'image/*'], 'pluginOptions' => [ 'deleteUrl' => 'file/delete', 'allowedFileExtensions'=>['jpg', 'jpeg', 'gif','png'], 'previewFileType' => "image", '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'=>"Cliquez sur parcourir pour ajouter un avatar, puis transférer...", 'initialPreviewConfig' => [ ['caption' => 'Moon.jpg', 'size' => '873727', 'key' => '1', 'downloadUrl' => "http://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/FullMoon2010.jpg/631px-FullMoon2010.jpg"], ['caption' => 'Earth.jpg', 'size' => '1287883', 'key' => '2' , 'downloadUrl'=> "http://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/Earth_Eastern_Hemisphere.jpg/600px-Earth_Eastern_Hemisphere.jpg"], ], 'overwriteInitial'=>false, 'maxFileSize'=>100, 'otherActionButtons' => $btns, ] ])->label(false);
Result display "{downloadUrl}". Test is dirty only for testing purpose ;)
When I follow those steps, I see...
I was expecting...
Browsers
Operating System
Libraries
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Steps to reproduce the issue
I use otherActionButtons in my widget. {dataKey} no problem. {caption} no problem. But impossible to use {downloadUrl} => not replaced
My code :
Result display "{downloadUrl}". Test is dirty only for testing purpose ;)
Expected behavior and actual behavior
When I follow those steps, I see...
I was expecting...
Environment
Browsers
Operating System
Libraries