-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·37 lines (34 loc) · 973 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
@include_once __DIR__ . '/vendor/autoload.php';
use Romans\Filter\RomanToInt;
use Romans\Filter\IntToRoman;
Kirby::plugin('moevbiz/k3-romans', [
'fieldMethods' => [
'romanToInt' => function ($field)
{
$filter = new RomanToInt();
$result = $filter->filter($field->value());
return $result;
},
'intToRoman' => function ($field)
{
$filter = new IntToRoman();
$result = $filter->filter($field->value());
return $result;
}
],
'pageMethods' => [
'romanToInt' => function (string $value): int
{
$filter = new RomanToInt();
$result = $filter->filter($value);
return $result;
},
'intToRoman' => function (int $value): string
{
$filter = new IntToRoman();
$result = $filter->filter($value);
return $result;
}
]
]);