From 134affc69e17bb002a4777b736b52a35eea0213f Mon Sep 17 00:00:00 2001 From: noelma Date: Wed, 20 Nov 2019 21:36:59 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20pour=20la=20version=20al?= =?UTF-8?q?pha9=20du=20CMS.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/routes.php | 14 ++++++++++ Config/routing.json | 54 --------------------------------------- Controller/Starterkit.php | 2 +- Installer.php | 2 +- composer.json | 6 ++--- 5 files changed, 18 insertions(+), 60 deletions(-) create mode 100644 Config/routes.php delete mode 100644 Config/routing.json diff --git a/Config/routes.php b/Config/routes.php new file mode 100644 index 0000000..4da093d --- /dev/null +++ b/Config/routes.php @@ -0,0 +1,14 @@ + '\d']); +R::get('starterkit.create', 'starterkit/item', 'Starterkit@create'); +R::post('starterkit.store', 'starterkit/item', 'Starterkit@store'); +R::get('starterkit.edit', 'starterkit/:id/edit', 'Starterkit@edit', [':id' => '\d']); +R::post('starterkit.update', 'starterkit/:id/edit', 'Starterkit@update', [':id' => '\d']); +R::post('starterkit.delete', 'starterkit/:id/delete', 'Starterkit@delete', [':id' => '\d']); diff --git a/Config/routing.json b/Config/routing.json deleted file mode 100644 index 7d8e7ad..0000000 --- a/Config/routing.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "starterkit.index": { - "methode": "GET", - "path": "starterkit/index", - "uses": "Starterkit@index" - }, - "starterkit.admin": { - "methode": "GET", - "path": "admin/starterkit", - "uses": "Starterkit@admin" - }, - "starterkit.show": { - "methode": "GET", - "path": "starterkit/:id", - "uses": "Starterkit@show", - "with": { - ":id": "\\d+" - } - }, - "starterkit.create": { - "methode": "GET", - "path": "starterkit/item", - "uses": "Starterkit@create" - }, - "starterkit.store": { - "methode": "POST", - "path": "starterkit/item", - "uses": "Starterkit@store" - }, - "starterkit.edit": { - "methode": "GET", - "path": "starterkit/:id/edit", - "uses": "Starterkit@edit", - "with": { - ":id": "\\d+" - } - }, - "starterkit.update": { - "methode": "POST", - "path": "starterkit/:id/edit", - "uses": "Starterkit@update", - "with": { - ":id": "\\d+" - } - }, - "starterkit.delete": { - "methode": "POST", - "path": "starterkit/:id/delete", - "uses": "Starterkit@delete", - "with": { - ":id": "\\d+" - } - } -} diff --git a/Controller/Starterkit.php b/Controller/Starterkit.php index db6af36..a42cccd 100644 --- a/Controller/Starterkit.php +++ b/Controller/Starterkit.php @@ -11,7 +11,7 @@ class Starterkit extends \Soosyze\Controller public function __construct() { $this->pathServices = dirname(__DIR__) . '/Config/service.json'; - $this->pathRoutes = dirname(__DIR__) . '/Config/routing.json'; + $this->pathRoutes = dirname(__DIR__) . '/Config/routes.php'; $this->pathViews = dirname(__DIR__) . '/Views/'; } diff --git a/Installer.php b/Installer.php index 3cbdace..bbea906 100644 --- a/Installer.php +++ b/Installer.php @@ -7,7 +7,7 @@ class Installer implements \SoosyzeCore\System\Migration { - public function getComposer() + public function getDir() { return __DIR__ . '/composer.json'; } diff --git a/composer.json b/composer.json index 5dcb1d6..147fa0e 100644 --- a/composer.json +++ b/composer.json @@ -9,12 +9,10 @@ } }, "extra": { - "soosyze-module": { + "soosyze": { "title": "Starterkit", "package": "Development", - "controllers": { - "Starterkit": "SoosyzeExtension\\Starterkit\\Controller\\Starterkit" - }, + "controller": "SoosyzeExtension\\Starterkit\\Controller\\Starterkit", "icon": { "background-color": "#222351", "color": "#fff"