3 declare(strict_types
=1);
5 namespace PhpMyAdmin\Controllers
;
7 use PhpMyAdmin\DatabaseInterface
;
8 use PhpMyAdmin\Http\ServerRequest
;
9 use PhpMyAdmin\Message
;
10 use PhpMyAdmin\ResponseRenderer
;
11 use PhpMyAdmin\Template
;
13 final class TableController
extends AbstractController
15 public function __construct(ResponseRenderer
$response, Template
$template, private DatabaseInterface
$dbi)
17 parent
::__construct($response, $template);
20 public function __invoke(ServerRequest
$request): void
22 if (! $request->hasBodyParam('db')) {
23 $this->response
->setRequestStatus(false);
24 $this->response
->addJSON(['message' => Message
::error()]);
29 $this->response
->addJSON(['tables' => $this->dbi
->getTables($request->getParsedBodyParam('db'))]);