proxitok/app/Controllers/SettingsController.php

32 lines
744 B
PHP
Raw Normal View History

<?php
2022-01-30 18:02:52 -05:00
namespace App\Controllers;
2022-01-30 18:02:52 -05:00
use App\Helpers\Misc;
use App\Helpers\Cookies;
use App\Helpers\Wrappers;
use App\Models\BaseTemplate;
2022-01-28 09:54:09 -05:00
2022-01-30 18:02:52 -05:00
class SettingsController {
static public function index() {
$latte = Wrappers::latte();
$latte->render(Misc::getView('settings'), new BaseTemplate('Settings'));
2022-01-30 18:02:52 -05:00
}
static private function redirect() {
$url = Misc::url('/settings');
header("Location: {$url}");
}
static public function general() {
if (isset($_POST['theme'])) {
$theme = $_POST['theme'];
Cookies::set('theme', $theme);
}
self::redirect();
2022-01-30 18:02:52 -05:00
}
static public function api() {
2022-06-04 15:04:43 -04:00
// TODO, ADD COUNT
self::redirect();
}
2022-01-30 18:02:52 -05:00
}