M
M
Maxim2018-09-26 22:10:12
Yii
Maxim, 2018-09-26 22:10:12

Yii how to style the download button and display the image in the maxmirazh33\image\Widget widget?

Hello! The question is not specifically about Yii, but about the extension https://github.com/maxmirazh33/yii2-uploadable-cro... . If anyone used it - tell me)
1. How to style a button for your own? Widget in use

$form->field($model, 'avatar')->widget('maxmirazh33\image\Widget')

The button itself is formed in the maxmirazh33\image\Widget widget. I understand that I need to inherit this widget and make my own button formation method. So it will be correct?)
2. I did not understand how to display a preview of the image in the editing form. Does anyone know how?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-09-28
@myks92

Styling is about css, you don't need to inherit anything here.
Adding buttons is more difficult, but the widget itself is based on https://jcrop.com, so it might be easier to write your own using https://github.com/tapmodo/Jcrop

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question