Image Preview

Show the preview of an image without the upload feature

To show an image in a form, no option type is necessary. Simply add a field with the following options:

 

addField([
   'type' => 'imgPreview', //required
   'value' => $product->result(0,'thumb_url'),
   'title' => $product->result(0,'title_'.$kas['main_lang']), //optional
   'alt'  => 'product image', // optional
   'class'  => 'img_preview', //optional, img_preview by default
   'id'  => '', //optional, empty by default
   'icon'  => '<i class="far fa-image"></i>' //optional, this is the default
]);