浏览代码

Modification du formulaire "Paramètres" du backend

Suppression du logo et du descriptif inutiles pour le moment.

Génération d'un lien correct pour la photo (url locale ou distante).
prodstable
keun 8 年前
父节点
当前提交
6118a865cc
共有 1 个文件被更改,包括 12 次插入24 次删除
  1. +12
    -24
      backend/views/etablissement/update.php

+ 12
- 24
backend/views/etablissement/update.php 查看文件

<h1><?= Html::encode($this->title) ?></h1> <h1><?= Html::encode($this->title) ?></h1>


<div class="user-form"> <div class="user-form">

<?php $form = ActiveForm::begin(); ?> <?php $form = ActiveForm::begin(); ?>
<div class="col-md-6">
<div class="">
<?= $form->field($model, 'code_postal') ?> <?= $form->field($model, 'code_postal') ?>
<?= $form->field($model, 'ville') ?> <?= $form->field($model, 'ville') ?>
<?= $form->field($model, 'description')->textarea(['rows' => 10]) ?>
<div class="form-group">
<?= Html::submitButton('Mettre à jour', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
</div>

<div class="col-md-6">
<?= $form->field($model, 'logo')->fileInput() ?>
<?php
if (strlen($model->logo)) {
echo '<img src="../../frontend/web/uploads/' . $model->logo . '" width="200px" /><br />';
echo '<input type="checkbox" name="delete_logo" id="delete_logo" /> <label for="delete_logo">Supprimer le logo</label><br /><br />';
}
?>
<?php //$form->field($model, 'description')->textarea(['rows' => 10]) ?>
<?= $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="400px" /><br />';
if(Yii::$app->getRequest()->serverName == 'localhost')
$base_url = '../../frontend/web/' ;
else
$base_url = 'http://www.laboiteapain.net/' ;
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 />';
} }
?> ?>
<div class="form-group">
<?= Html::submitButton('Mettre à jour', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
</div> </div>





<?php ActiveForm::end(); ?> <?php ActiveForm::end(); ?>
</div> </div>



正在加载...
取消
保存