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