Answer the question
In order to leave comments, you need to log in
Yii file upload in admin?
There is a site on which there is an admin panel, the admin panel provides for adding / editing products. The product has an attached file. All solutions, recipes describe a method in which the file is attached without problems, but when you edit the product, you have to re-upload the file all the time. How to make it so that when editing a product, the file should be loaded only when it needs to be changed?
Answer the question
In order to leave comments, you need to log in
Purely telepathically, probably like this
Remove the check for a required field from the rules
Where the value assigned to the model is added something like this
if(!empty($filePath)){
$model->image_url = $filePath
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question