mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
31 lines
No EOL
617 B
PHP
31 lines
No EOL
617 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Yggverse\Yoda\Model;
|
|
|
|
class Page
|
|
{
|
|
public static function get(string $name): ?string
|
|
{
|
|
$name = ucfirst(
|
|
mb_strtolower(
|
|
$name
|
|
)
|
|
);
|
|
|
|
$filename = __DIR__ .
|
|
DIRECTORY_SEPARATOR . '..' .
|
|
DIRECTORY_SEPARATOR . 'Page' .
|
|
DIRECTORY_SEPARATOR . $name . '.gmi';
|
|
|
|
if (file_exists($filename) && is_readable($filename))
|
|
{
|
|
return file_get_contents(
|
|
$filename
|
|
);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
} |