P
P
pedopi64252020-12-08 07:09:32
Yii
pedopi6425, 2020-12-08 07:09:32

Loading pictures in the middle of a yii2 article?

There is a small blog with news, when adding news text in the admin panel, you may need to attach a picture that will hang in a random place. While the idea is, when you click on the "add picture" button, add an img tag to the textarea (where all the text of the news is), generate a random string and enter it in src, and enter it in the input file. And how would you implement such an option, experienced comrades?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lander, 2020-12-08
@usdglander

Any WYSIWYG editor allows you to do such things. Alex Glebov suggested Ckeditor - you can use it.

A
Alexander Lykasov, 2020-12-08
@lykasov-aleksandr

As already noted above, it is better to give the user a normal editor. In addition to Ckeditor for Yii, there is also Redactor. It was bought by the Yii community and is now free to use in Yii projects. Here is the finished composer package with various plugins, including image and file uploads.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question