Browse Source

[backend] Product : correction bug affichage photo dans le formulaire de modification

dev
Guillaume Bourgeois 5 years ago
parent
commit
b83ec97451
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      backend/views/product/_form.php

+ 2
- 1
backend/views/product/_form.php View File

<?= $form->field($model, 'photo')->fileInput() ?> <?= $form->field($model, 'photo')->fileInput() ?>
<?php <?php
if(strlen($model->photo)) { if(strlen($model->photo)) {
echo '<img src="'.Yii::$app->urlManagerProducer->getBaseUrl().'/uploads/'.$model->photo.'" width="200px" /><br />' ;
$url = Yii::$app->urlManagerProducer->getHostInfo().'/'.Yii::$app->urlManagerProducer->baseUrl ;
echo '<img class="photo-product" src="'.$url.'/uploads/'.$model->photo.'" width="200px" /><br />' ;
echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />' ; echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />' ;
} }
?> ?>

Loading…
Cancel
Save