api.php 468 B

12345678910111213
  1. <?php
  2. $app->get('/plugins/test/settings', function ($request, $response, $args) {
  3. $TestPlugin = new TestPlugin();
  4. if ($TestPlugin->checkRoute($request)) {
  5. if ($TestPlugin->qualifyRequest(1, true)) {
  6. $GLOBALS['api']['response']['data'] = $TestPlugin->_pluginGetSettings();
  7. }
  8. }
  9. $response->getBody()->write(jsonE($GLOBALS['api']));
  10. return $response
  11. ->withHeader('Content-Type', 'application/json;charset=UTF-8')
  12. ->withStatus($GLOBALS['responseCode']);
  13. });