flash.moe/src/Tools/AsciiRoutes.php

26 lines
721 B
PHP

<?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/index');
}
#[Route('GET', '/ascii.php')]
public function getAsciiPHP($response, $request): void {
$response->redirect('/ascii', true);
}
}