Answer the question
In order to leave comments, you need to log in
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
Any WYSIWYG editor allows you to do such things. Alex Glebov suggested Ckeditor - you can use it.
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 questionAsk a Question
731 491 924 answers to any question