Browse Source

Déplacement du dossier uploads frontend vers producer

dev
keun 6 years ago
parent
commit
25e348b45d
6 changed files with 8 additions and 29 deletions
  1. +2
    -0
      backend/controllers/EtablissementController.php
  2. +2
    -2
      backend/views/etablissement/update.php
  3. +0
    -25
      backend/web/index_1.php
  4. +1
    -1
      common/helpers/Upload.php
  5. +1
    -1
      producer/views/producer/index.php
  6. +2
    -0
      producer/web/uploads/.gitignore

+ 2
- 0
backend/controllers/EtablissementController.php View File

@@ -19,6 +19,8 @@ use common\models\Facture;
*/
class EtablissementController extends BackendController {

public $enableCsrfValidation = false;
public function behaviors() {
return [
'verbs' => [

+ 2
- 2
backend/views/etablissement/update.php View File

@@ -83,8 +83,8 @@ $this->params['breadcrumbs'][] = 'Paramètres';
<?= $form->field($model, 'photo')->fileInput() ?>
<?php
if (strlen($model->photo)) {
$base_url = Url::frontend() ;
echo '<img src="'.$base_url.'uploads/' . $model->photo . '" width="400px" /><br />';
$base_url = Yii::$app->urlManagerProducer->baseUrl ;
echo '<img src="'.$base_url.'/uploads/' . $model->photo . '" width="400px" /><br />';
echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />';
}
?>

+ 0
- 25
backend/web/index_1.php View File

@@ -1,25 +0,0 @@
<?php

date_default_timezone_set('Europe/Paris');

defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

require(__DIR__ . '/../../vendor/autoload.php');
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/../../common/config/bootstrap.php');
require(__DIR__ . '/../config/bootstrap.php');

$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../common/config/main.php'),
require(__DIR__ . '/../../common/config/main-local.php'),
require(__DIR__ . '/../config/main.php'),
require(__DIR__ . '/../config/main-local.php')
);

$application = new yii\web\Application($config);

date_default_timezone_set('Europe/Paris');
setlocale(LC_TIME, 'fr_FR.utf8','fra');

$application->run();

+ 1
- 1
common/helpers/Upload.php View File

@@ -18,7 +18,7 @@ class Upload {
if ($file) {
$file_name = $file->baseName . '-' . uniqid() ;
$file_name_extension = $file_name .'.'.$file->extension ;
$dir_file = '../../frontend/web/uploads/' ;
$dir_file = '../../producer/web/uploads/' ;
$path_file = $dir_file . $file_name_extension ;
$file->saveAs($path_file);

+ 1
- 1
producer/views/producer/index.php View File

@@ -14,7 +14,7 @@ else
<section id="presentation">
<?php if(strlen($producer->photo)): ?>
<div class="photo <?= $col_size ?>">
<img class="img-photo" src="<?= Yii::$app->urlManagerFrontend->baseUrl; ?>/uploads/<?= $producer->photo; ?>" alt="Photo <?= Html::encode($producer->nom) ?>" />
<img class="img-photo" src="<?= Yii::$app->urlManager->baseUrl; ?>/uploads/<?= $producer->photo; ?>" alt="Photo <?= Html::encode($producer->nom) ?>" />
</div>
<?php endif; ?>
<?php if(strlen($producer->description)): ?>

+ 2
- 0
producer/web/uploads/.gitignore View File

@@ -0,0 +1,2 @@
*
!.gitignore

Loading…
Cancel
Save