Przeglądaj źródła

Mise en place de l'environnement de production (suite)

master
keun 8 lat temu
rodzic
commit
9abed3dcce
3 zmienionych plików z 5 dodań i 7 usunięć
  1. +2
    -6
      backend/views/etablissement/update.php
  2. +2
    -0
      common/helpers/Url.php
  3. +1
    -1
      frontend/views/layouts/main.php

+ 2
- 6
backend/views/etablissement/update.php Wyświetl plik

@@ -2,6 +2,7 @@

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\helpers\Url ;

/* @var $this yii\web\View */
/* @var $model common\models\User */
@@ -67,12 +68,7 @@ $this->params['breadcrumbs'][] = 'Paramètres';
<?= $form->field($model, 'photo')->fileInput() ?>
<?php
if (strlen($model->photo)) {
if(Yii::$app->getRequest()->serverName == 'localhost')
$base_url = '../../frontend/web/' ;
else
$base_url = 'http://www.laboiteapain.net/' ;
$base_url = Url::frontend() ;
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 />';
}

+ 2
- 0
common/helpers/Url.php Wyświetl plik

@@ -6,6 +6,8 @@
* and open the template in the editor.
*/

use yii ;

namespace common\helpers;

class Url

+ 1
- 1
frontend/views/layouts/main.php Wyświetl plik

@@ -56,7 +56,7 @@ AppAsset::register($this);
</ul>
</nav>
</div>
</header>Yii::$app->getRequest()->serverName == 'localhost'
</header>
<div id="main">
<section class="<?php if(!$is_home): ?>container<?php endif;?>" id="content">
<?php if(Yii::$app->session->hasFlash('error')): ?>

Ładowanie…
Anuluj
Zapisz