Browse Source

Adaptations backend/product

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

+ 2
- 2
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="../../frontend/web/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 '<img src="'.Yii::$app->urlManagerProducer->getBaseUrl().'/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 />' ;
} }
?> ?>

+ 1
- 1
backend/views/product/index.php View File

'value' => function($model) { 'value' => function($model) {
if(strlen($model->photo)) { if(strlen($model->photo)) {
$url = Yii::$app->urlManagerProducer->getBaseUrl() ; $url = Yii::$app->urlManagerProducer->getBaseUrl() ;
return '<img class="photo-produit" src="'.$url.'uploads/'.$model->photo.'" />' ;
return '<img class="photo-product" src="'.$url.'/uploads/'.$model->photo.'" />' ;
} }
return '' ; return '' ;
} }

Loading…
Cancel
Save