The yii2 I used is an article site. All the images in the published articles are saved at the relative address. In frontendweb, the background needs to see the picture to review the article, however, the relative address is found under backendweb. Is there any idea to browse the foreground images in the background? Ps: said before... the yii2 I used is an article site. All the pictures in the published articles are saved with relative addresses. In frontend/web, the background must view the pictures to review the articles, however, the relative address is found under backend/web. Is there any idea to browse the foreground images in the background?
Ps: I am not very clear about what I mentioned earlier. I used a relative address to store the data in the database, for example, upload/images/1.jpg. the address for reading is www.xxx.com/upload/images/1.jpg, which is the frontend. After the backend reads backend.xxx.com/upload/images/1.jpg, the address is incorrect. The image is embedded in the article, and the backend display is difficult for me to change the src address. I don't know what to do.
Reply content:
The yii2 I used is an article site. All the pictures in the published articles are saved with relative addresses. In frontend/web, the background must view the pictures to review the articles, however, the relative address is found under backend/web. Is there any idea to browse the foreground images in the background?
Ps: I am not very clear about what I mentioned earlier. I used a relative address to store the data in the database, for example, upload/images/1.jpg. the address for reading is www.xxx.com/upload/images/1.jpg, which is the frontend. After the backend reads backend.xxx.com/upload/images/1.jpg, the address is incorrect. The image is embedded in the article, and the backend display is difficult for me to change the src address. I don't know what to do.
-. -The database reads upload/images/1.jpg and manually adds the full address to it.
What does it mean? How can I find another address with a relative address?
Store image data into the database when publishing an article
Then, read the database in the background and list the images.
During the upload, save the image in a location, get the location, and write it to the database.
When displayed in the background, get the corresponding data and write it in the img tag.