diff --git a/composer.json b/composer.json index 87174f0f95a154c4d1264cefe46bdda83da35394..d9eeb394501c959d44d92977a53fd88753963d81 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,9 @@ { "require": { - "slim/slim": "3.*", - "twig/twig": "~1.0", - "illuminate/database": "4.2.9" + "slim/slim": "4.13.0", + "slim/psr7": "^1.6", + "twig/twig": "3.8.0.*", + "illuminate/database": "v10.46.0" }, "autoload":{ "psr-0":{ diff --git a/controller/KeyGenerator.php b/controller/KeyGenerator.php index d4163aa06ff2f2a08e7b5530eb84e3905a94c408..5de885c4286c87857971cf3b7398d6c9a7e2b864 100644 --- a/controller/KeyGenerator.php +++ b/controller/KeyGenerator.php @@ -7,7 +7,7 @@ use model\ApiKey; class KeyGenerator { function show($twig, $menu, $chemin, $cat) { - $template = $twig->loadTemplate("key-generator.html.twig"); + $template = $twig->load("key-generator.html.twig"); $menu = array( array('href' => $chemin, 'text' => 'Acceuil'), @@ -21,7 +21,7 @@ class KeyGenerator { $nospace_nom = str_replace(' ', '', $nom); if($nospace_nom === '') { - $template = $twig->loadTemplate("key-generator-error.html.twig"); + $template = $twig->load("key-generator-error.html.twig"); $menu = array( array('href' => $chemin, 'text' => 'Acceuil'), @@ -31,7 +31,7 @@ class KeyGenerator { echo $template->render(array("breadcrumb" => $menu, "chemin" => $chemin, "categories" => $cat)); } else { - $template = $twig->loadTemplate("key-generator-result.html.twig"); + $template = $twig->load("key-generator-result.html.twig"); $menu = array( array('href' => $chemin, 'text' => 'Acceuil'), diff --git a/controller/Search.php b/controller/Search.php index fc0b01edbf55d4e682dd19d539e44ba824c2d48c..baecff16611057625e04316f0c355ca5758def54 100644 --- a/controller/Search.php +++ b/controller/Search.php @@ -7,8 +7,8 @@ use model\Categorie; class Search { - function show($twig, $menu, $chemin, $cat) { - $template = $twig->loadTemplate("search.html.twig"); + function show($twig, $menu, $chemin, $public, $cat) { + $template = $twig->load("search.html.twig"); $menu = array( array('href' => $chemin, 'text' => 'Acceuil'), @@ -19,7 +19,7 @@ class Search { } function research($array, $twig, $menu, $chemin, $cat) { - $template = $twig->loadTemplate("index.html.twig"); + $template = $twig->load("index.html.twig"); $menu = array( array('href' => $chemin, 'text' => 'Acceuil'), @@ -41,7 +41,6 @@ class Search { $annonce = Annonce::all(); } else { - // A REFAIRE SEPARER LES TRUCS if( ($nospace_mc !== "") ) { $query->where('description', 'like', '%'.$array['motclef'].'%'); } diff --git a/controller/addItem.php b/controller/addItem.php index deb5bed14cae34f3c512272655dd213246ffe56e..df9f78ea67177dce6809e19007efa780a74c056e 100755 --- a/controller/addItem.php +++ b/controller/addItem.php @@ -9,13 +9,13 @@ class addItem{ function addItemView($twig, $menu, $chemin, $cat, $dpt){ - $template = $twig->loadTemplate("add.html.twig"); + $template = $twig->load("add.html.twig"); echo $template->render(array( - "breadcrumb" => $menu, - "chemin" => $chemin, - "categories" => $cat, - "departements" => $dpt) - ); + "breadcrumb" => $menu, + "chemin" => $chemin, + "categories" => $cat, + "departements" => $dpt) + ); } @@ -146,12 +146,12 @@ class addItem{ // S'il y a des erreurs on redirige vers la page d'erreur if (!empty($errors)) { - $template = $twig->loadTemplate("add-error.html.twig"); + $template = $twig->load("add-error.html.twig"); echo $template->render(array( - "breadcrumb" => $menu, - "chemin" => $chemin, - "errors" => $errors) - ); + "breadcrumb" => $menu, + "chemin" => $chemin, + "errors" => $errors) + ); } // sinon on ajoute à la base et on redirige vers une page de succès else{ @@ -176,7 +176,7 @@ class addItem{ $annonceur->annonce()->save($annonce); - $template = $twig->loadTemplate("add-confirm.html.twig"); + $template = $twig->load("add-confirm.html.twig"); echo $template->render(array("breadcrumb" => $menu, "chemin" => $chemin)); } } diff --git a/controller/getCategorie.php b/controller/getCategorie.php index 6f816aae4535005ae1eca223b5706ff68909ace2..f28de4b2625e559d019d74a2c2c76d6eb2d765fa 100644 --- a/controller/getCategorie.php +++ b/controller/getCategorie.php @@ -36,7 +36,7 @@ class getCategorie { } public function displayCategorie($twig, $menu, $chemin, $cat, $n) { - $template = $twig->loadTemplate("index.html.twig"); + $template = $twig->load("index.html.twig"); $menu = array( array('href' => $chemin, 'text' => 'Acceuil'), diff --git a/controller/index.php b/controller/index.php index 075971a0beb083ce905e69802eff3ed11b403db8..c8442e9e2ad2e3e6c00646e9e55b8e8506698ec5 100644 --- a/controller/index.php +++ b/controller/index.php @@ -33,7 +33,7 @@ class index { } public function displayAllAnnonce($twig, $menu, $chemin, $cat) { - $template = $twig->loadTemplate("index.html.twig"); + $template = $twig->load("index.html.twig"); $menu = array( array('href' => $chemin, 'text' => 'Acceuil'), diff --git a/controller/item.php b/controller/item.php index 83812104ea953a2b8420e79137add103662920f9..934f90439cc26eac8354592e6fece12bef2687f0 100644 --- a/controller/item.php +++ b/controller/item.php @@ -24,13 +24,13 @@ class item { array('href' => $chemin."/cat/".$n, 'text' => Categorie::find($this->annonce->id_categorie)->nom_categorie), array('href' => $chemin."/item/".$n, - 'text' => $this->annonce->titre) + 'text' => $this->annonce->titre) ); $this->annonceur = Annonceur::find($this->annonce->id_annonceur); $this->departement = Departement::find($this->annonce->id_departement ); $this->photo = Photo::where('id_annonce', '=', $n)->get(); - $template = $twig->loadTemplate("item.html.twig"); + $template = $twig->load("item.html.twig"); echo $template->render(array("breadcrumb" => $menu, "chemin" => $chemin, "annonce" => $this->annonce, @@ -46,7 +46,7 @@ class item { echo "404"; return; } - $template = $twig->loadTemplate("delGet.html.twig"); + $template = $twig->load("delGet.html.twig"); echo $template->render(array("breadcrumb" => $menu, "chemin" => $chemin, "annonce" => $this->annonce)); @@ -63,7 +63,7 @@ class item { } - $template = $twig->loadTemplate("delPost.html.twig"); + $template = $twig->load("delPost.html.twig"); echo $template->render(array("breadcrumb" => $menu, "chemin" => $chemin, "annonce" => $this->annonce, @@ -77,7 +77,7 @@ class item { echo "404"; return; } - $template = $twig->loadTemplate("modifyGet.html.twig"); + $template = $twig->load("modifyGet.html.twig"); echo $template->render(array("breadcrumb" => $menu, "chemin" => $chemin, "annonce" => $this->annonce)); @@ -95,7 +95,7 @@ class item { } - $template = $twig->loadTemplate("modifyPost.html.twig"); + $template = $twig->load("modifyPost.html.twig"); echo $template->render(array("breadcrumb" => $menu, "chemin" => $chemin, "annonce" => $this->annonce, @@ -178,7 +178,7 @@ class item { // S'il y a des erreurs on redirige vers la page d'erreur if (!empty($errors)) { - $template = $twig->loadTemplate("add-error.html.twig"); + $template = $twig->load("add-error.html.twig"); echo $template->render(array( "breadcrumb" => $menu, "chemin" => $chemin, @@ -207,7 +207,7 @@ class item { $this->annonceur->annonce()->save($this->annonce); - $template = $twig->loadTemplate("modif-confirm.html.twig"); + $template = $twig->load("modif-confirm.html.twig"); echo $template->render(array("breadcrumb" => $menu, "chemin" => $chemin)); } } diff --git a/controller/viewAnnonceur.php b/controller/viewAnnonceur.php index 4768c493fdce7e4dd0f5a2a1a6bb182cdbccd522..4ee237745add1283c9d29200c139c7c2bc17d6e1 100644 --- a/controller/viewAnnonceur.php +++ b/controller/viewAnnonceur.php @@ -35,7 +35,7 @@ class viewAnnonceur { $annonces[] = $a; } - $template = $twig->loadTemplate("annonceur.html.twig"); + $template = $twig->load("annonceur.html.twig"); echo $template->render(array('nom' => $this->annonceur, "chemin" => $chemin, "annonces" => $annonces, diff --git a/template/item.html.twig b/template/item.html.twig index e2218218bc96853a0d2de5d1c05008a5a1b855a8..4cd8d10858bec8df34b3d70d5a92f7574190c416 100644 --- a/template/item.html.twig +++ b/template/item.html.twig @@ -16,7 +16,7 @@ </div> <div class="item-min"> {% for p in photo %} - <img class="min_img" src="{{ p.url_photo }}" alt="" title=""/> + <img class="min_img" src="{{ p.url_photo }}" alt="" title=""/> {% endfor %} </div> </div>