Browse Source

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

prodstable
keun 8 years ago
parent
commit
9abed3dcce
3 changed files with 5 additions and 7 deletions
  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 View File



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


/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model common\models\User */ /* @var $model common\models\User */
<?= $form->field($model, 'photo')->fileInput() ?> <?= $form->field($model, 'photo')->fileInput() ?>
<?php <?php
if (strlen($model->photo)) { 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 '<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 />'; 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 View File

* and open the template in the editor. * and open the template in the editor.
*/ */


use yii ;

namespace common\helpers; namespace common\helpers;


class Url class Url

+ 1
- 1
frontend/views/layouts/main.php View File

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

Loading…
Cancel
Save