@@ -19,6 +19,8 @@ use common\models\Facture; | |||
*/ | |||
class EtablissementController extends BackendController { | |||
public $enableCsrfValidation = false; | |||
public function behaviors() { | |||
return [ | |||
'verbs' => [ |
@@ -83,8 +83,8 @@ $this->params['breadcrumbs'][] = 'Paramètres'; | |||
<?= $form->field($model, 'photo')->fileInput() ?> | |||
<?php | |||
if (strlen($model->photo)) { | |||
$base_url = Url::frontend() ; | |||
echo '<img src="'.$base_url.'uploads/' . $model->photo . '" width="400px" /><br />'; | |||
$base_url = Yii::$app->urlManagerProducer->baseUrl ; | |||
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 />'; | |||
} | |||
?> |
@@ -1,25 +0,0 @@ | |||
<?php | |||
date_default_timezone_set('Europe/Paris'); | |||
defined('YII_DEBUG') or define('YII_DEBUG', true); | |||
defined('YII_ENV') or define('YII_ENV', 'dev'); | |||
require(__DIR__ . '/../../vendor/autoload.php'); | |||
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'); | |||
require(__DIR__ . '/../../common/config/bootstrap.php'); | |||
require(__DIR__ . '/../config/bootstrap.php'); | |||
$config = yii\helpers\ArrayHelper::merge( | |||
require(__DIR__ . '/../../common/config/main.php'), | |||
require(__DIR__ . '/../../common/config/main-local.php'), | |||
require(__DIR__ . '/../config/main.php'), | |||
require(__DIR__ . '/../config/main-local.php') | |||
); | |||
$application = new yii\web\Application($config); | |||
date_default_timezone_set('Europe/Paris'); | |||
setlocale(LC_TIME, 'fr_FR.utf8','fra'); | |||
$application->run(); |
@@ -18,7 +18,7 @@ class Upload { | |||
if ($file) { | |||
$file_name = $file->baseName . '-' . uniqid() ; | |||
$file_name_extension = $file_name .'.'.$file->extension ; | |||
$dir_file = '../../frontend/web/uploads/' ; | |||
$dir_file = '../../producer/web/uploads/' ; | |||
$path_file = $dir_file . $file_name_extension ; | |||
$file->saveAs($path_file); | |||
@@ -14,7 +14,7 @@ else | |||
<section id="presentation"> | |||
<?php if(strlen($producer->photo)): ?> | |||
<div class="photo <?= $col_size ?>"> | |||
<img class="img-photo" src="<?= Yii::$app->urlManagerFrontend->baseUrl; ?>/uploads/<?= $producer->photo; ?>" alt="Photo <?= Html::encode($producer->nom) ?>" /> | |||
<img class="img-photo" src="<?= Yii::$app->urlManager->baseUrl; ?>/uploads/<?= $producer->photo; ?>" alt="Photo <?= Html::encode($producer->nom) ?>" /> | |||
</div> | |||
<?php endif; ?> | |||
<?php if(strlen($producer->description)): ?> |
@@ -0,0 +1,2 @@ | |||
* | |||
!.gitignore |