Translated using Weblate (Slovenian)
[phpmyadmin.git] / src / Controllers / TableController.php
blobafad69eca4ab31be759279b588c31c00fa5ad6dc
1 <?php
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()]);
26 return;
29 $this->response->addJSON(['tables' => $this->dbi->getTables($request->getParsedBodyParam('db'))]);