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');
|
|
|
|
|
2023-10-13 18:01:07 +00:00
|
|
|
return $this->templating->render('ascii/index');
|
2023-10-12 22:09:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[Route('GET', '/ascii.php')]
|
|
|
|
public function getAsciiPHP($response, $request): void {
|
|
|
|
$response->redirect('/ascii', true);
|
|
|
|
}
|
|
|
|
}
|