|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 />'; |
|
|
} |
|
|
} |