julienmonnerie/kirby/config/areas/site/views.php

28 lines
641 B
PHP
Raw Normal View History

2022-06-17 17:51:59 +02:00
<?php
2022-08-31 15:02:43 +02:00
use Kirby\Cms\App;
2022-06-17 17:51:59 +02:00
use Kirby\Cms\Find;
return [
2022-08-31 15:02:43 +02:00
'page' => [
'pattern' => 'pages/(:any)',
'action' => fn (string $path) => Find::page($path)->panel()->view()
],
'page.file' => [
'pattern' => 'pages/(:any)/files/(:any)',
'action' => function (string $id, string $filename) {
return Find::file('pages/' . $id, $filename)->panel()->view();
}
],
'site' => [
'pattern' => 'site',
'action' => fn () => App::instance()->site()->panel()->view()
],
'site.file' => [
'pattern' => 'site/files/(:any)',
'action' => function (string $filename) {
return Find::file('site', $filename)->panel()->view();
}
],
2022-06-17 17:51:59 +02:00
];