diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-12-16 16:04:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-16 16:04:15 +0100 |
commit | bd11879018416d2c5d87728bb0be6ee0cf54451a (patch) | |
tree | f3147ab9eef24ff430c131249166fe84d19a4b07 /plugins/demo_plugin/DemoPluginController.php | |
parent | 8f423eb11c6642d96b5144f56e4698652591ad6b (diff) | |
parent | a6e9c08499f9f79dad88cb3ae9eacda0e0c34c96 (diff) | |
download | Shaarli-bd11879018416d2c5d87728bb0be6ee0cf54451a.tar.gz Shaarli-bd11879018416d2c5d87728bb0be6ee0cf54451a.tar.zst Shaarli-bd11879018416d2c5d87728bb0be6ee0cf54451a.zip |
Merge pull request #1645 from ArthurHoaro/feature/plugin-register-route
Plugin system: allow plugins to provide custom routes
Diffstat (limited to 'plugins/demo_plugin/DemoPluginController.php')
-rw-r--r-- | plugins/demo_plugin/DemoPluginController.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/demo_plugin/DemoPluginController.php b/plugins/demo_plugin/DemoPluginController.php new file mode 100644 index 00000000..b8ace9c8 --- /dev/null +++ b/plugins/demo_plugin/DemoPluginController.php | |||
@@ -0,0 +1,24 @@ | |||
1 | <?php | ||
2 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Shaarli\DemoPlugin; | ||
6 | |||
7 | use Shaarli\Front\Controller\Admin\ShaarliAdminController; | ||
8 | use Slim\Http\Request; | ||
9 | use Slim\Http\Response; | ||
10 | |||
11 | class DemoPluginController extends ShaarliAdminController | ||
12 | { | ||
13 | public function index(Request $request, Response $response): Response | ||
14 | { | ||
15 | $this->assignView( | ||
16 | 'content', | ||
17 | '<div class="center">' . | ||
18 | 'This is a demo page. I have access to Shaarli container, so I\'m free to do whatever I want here.' . | ||
19 | '</div>' | ||
20 | ); | ||
21 | |||
22 | return $response->write($this->render('pluginscontent')); | ||
23 | } | ||
24 | } | ||