Bläddra i källkod

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

prodstable
keun 8 år sedan
förälder
incheckning
9abed3dcce
3 ändrade filer med 5 tillägg och 7 borttagningar
  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 Visa fil

@@ -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 Visa fil

@@ -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 Visa fil

@@ -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')): ?>

Laddar…
Avbryt
Spara