A
A
Absky2018-08-25 18:17:04
Yii
Absky, 2018-08-25 18:17:04

How can I use Yii2-images to load an image when a post is published?

Good afternoon,
in this plugin $model = Posts::findOne($id); takes the value of the id of the record in the database to which the association with the record of the uploaded image will be assigned. Is there any option to attach to a post that doesn't exist yet?
The option to write +1 to the id of the last entry is not suitable, it gives an error, because this entry does not exist.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bay, 2018-08-25
@Absky

In the afterSave() method;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question