phpmyadmin/libraries/classes/Controllers/ThemesController.php
Maurício Meneghini Fauth 865c46e320
Move Theme and ThemeManager into the Theme namespace
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-03-13 10:25:48 -03:00

27 lines
741 B
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers;
use PhpMyAdmin\Http\ServerRequest;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Template;
use PhpMyAdmin\Theme\ThemeManager;
class ThemesController extends AbstractController
{
public function __construct(ResponseRenderer $response, Template $template, private ThemeManager $themeManager)
{
parent::__construct($response, $template);
}
public function __invoke(ServerRequest $request): void
{
$themes = $this->themeManager->getThemesArray();
$themesList = $this->template->render('home/themes', ['themes' => $themes]);
$this->response->setAjax(true);
$this->response->addJSON('themes', $themesList);
}
}