flash.moe/src/Tools/AsciiRoutes.php

27 lines
715 B
PHP
Raw Normal View History

2023-10-12 22:09:04 +00:00
<?php
namespace Makai\Tools;
use Index\Routing\Route;
use Index\Routing\RouteHandler;
use Sasae\SasaeEnvironment;
class AsciiRoutes extends RouteHandler {
public function __construct(
private SasaeEnvironment $templating
) {}
#[Route('GET', '/ascii')]
public function getAsciiTable($response, $request): string {
$this->templating->addFilter('chr', 'chr');
$this->templating->addFilter('decoct', 'decoct');
$this->templating->addFilter('dechex', 'dechex');
return $this->templating->render('ascii');
}
#[Route('GET', '/ascii.php')]
public function getAsciiPHP($response, $request): void {
$response->redirect('/ascii', true);
}
}