From 0222bac963809c3c597ad85bdcf050c5fe511a32 Mon Sep 17 00:00:00 2001 From: nox Date: Fri, 25 Oct 2019 00:44:54 +0200 Subject: [PATCH] Nouvelles url - Modif Fil d'Ariane --- public/index.php | 3 +-- src/Gmarche/Actions/AntenneShowAction.php | 2 -- src/Gmarche/GmarcheModule.php | 4 ++-- src/Gmarche/config.php | 2 +- src/Gmarche/views/antenne.twig | 2 -- src/Product/Actions/ProductIndexAction.php | 4 +--- src/Product/ProductModule.php | 4 ---- src/Product/views/admin/products/index.twig | 4 +--- views/layout.twig | 6 +----- 9 files changed, 7 insertions(+), 24 deletions(-) diff --git a/public/index.php b/public/index.php index 1ba2bf9..a30e5bb 100644 --- a/public/index.php +++ b/public/index.php @@ -32,10 +32,9 @@ $app = (new \Framework\App( $chemin_new .'/config/config.php')) ->addModule(AuthModule::class) ->addModule(AccountModule::class); - $container = $app->getContainer(); -// Pose problème +// Pose un problème //$container->get(\Framework\Router::class)->get('/', \App\Gmarche\Actions\RegionIndexAction::class, 'home'); $app->pipe(Whoops::class); diff --git a/src/Gmarche/Actions/AntenneShowAction.php b/src/Gmarche/Actions/AntenneShowAction.php index f4fcf0d..e576a3e 100644 --- a/src/Gmarche/Actions/AntenneShowAction.php +++ b/src/Gmarche/Actions/AntenneShowAction.php @@ -37,7 +37,6 @@ class AntenneShowAction AntenneTable $antenneTable, ContainerInterface $container ) { - $this->renderer = $renderer; $this->regionTable = $regionTable; $this->antenneTable = $antenneTable; @@ -55,7 +54,6 @@ class AntenneShowAction $antennes = $this->antenneTable->findAllbyRegion($region_id)->paginate(25, $page); $region=$this->regionTable->findBy('slug', $request->getAttribute('slug')); - //$antenne = 1; /*if ($region->slug !== $slug) { return $this->redirect('gmarche.show', [ 'slug' => $region->slug, diff --git a/src/Gmarche/GmarcheModule.php b/src/Gmarche/GmarcheModule.php index 47e55da..ad076b9 100644 --- a/src/Gmarche/GmarcheModule.php +++ b/src/Gmarche/GmarcheModule.php @@ -20,7 +20,7 @@ class GmarcheModule extends Module $gmarchePrefix = $container->get('gmarche.prefix'); $container->get(RendererInterface::class)->addPath('gmarche', __DIR__ . '/views'); $router = $container->get(Router::class); - $router->get( '/france', RegionIndexAction::class, 'gmarche.index'); - $router->get("/france/{slug:[a-z\-0-9]+}", AntenneShowAction::class, 'gmarche.antenne'); + $router->get( "$gmarchePrefix", RegionIndexAction::class, 'gmarche.index'); + $router->get("$gmarchePrefix/{slug:[a-z\-0-9]+}", AntenneShowAction::class, 'gmarche.antenne'); } } diff --git a/src/Gmarche/config.php b/src/Gmarche/config.php index a0473f6..20f652a 100644 --- a/src/Gmarche/config.php +++ b/src/Gmarche/config.php @@ -3,7 +3,7 @@ use App\Gmarche\GmarcheModule; use function \Di\object; use function \Di\get; - +/* Chemin */ return [ 'gmarche.prefix' => '/france' ]; diff --git a/src/Gmarche/views/antenne.twig b/src/Gmarche/views/antenne.twig index 5f9bf1e..5c9d49a 100644 --- a/src/Gmarche/views/antenne.twig +++ b/src/Gmarche/views/antenne.twig @@ -26,8 +26,6 @@ grid-area: footer; } - -