From 995b4cfb9baaa63ec6b905ce5a92825b50ff1c6e Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 3 Aug 2020 20:53:40 +0000 Subject: [PATCH] [PLUGIN] Update example plugin --- plugins/Test/Controller/TestController.php | 11 ++++++----- plugins/Test/Test.php | 13 +++++++++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/plugins/Test/Controller/TestController.php b/plugins/Test/Controller/TestController.php index 41744c8e69..44ed398e88 100644 --- a/plugins/Test/Controller/TestController.php +++ b/plugins/Test/Controller/TestController.php @@ -1,14 +1,15 @@ Test controller '); + return new Response(' Test controller '); } } diff --git a/plugins/Test/Test.php b/plugins/Test/Test.php index 2b42c0f4dc..fabe50e7c6 100644 --- a/plugins/Test/Test.php +++ b/plugins/Test/Test.php @@ -2,10 +2,19 @@ namespace Plugin\Test; -class Test +use App\Core\Module; +use App\Core\Router\RouteLoader; +use Plugin\Test\Controller\TestController; + +class Test extends Module { public function onTest(string $foo) { - dump('Event handled: ' . $foo); + var_dump('Event handled: ' . $foo); + } + + public function onAddRoute(RouteLoader $r) + { + $r->connect('test_foo', '/foo', TestController::class); } }