actuel-inactuel/site/config/routes/virtual-author.php

26 lines
560 B
PHP
Raw Normal View History

2024-04-06 10:08:45 +02:00
<?php
use Kirby\Uuid\Uuid;
return [
'pattern' => 'auteurs/(:any)',
'action' => function ($slug) {
$kirby = kirby();
$author = getAuthorBySlug($slug);
return Page::factory(
[
'slug' => '',
'template' => 'author',
'model' => 'authors',
'content' => [
'title' => $author->name(),
'presentation' => $author->presentation(),
'author' => $author->name(),
'uuid' => Uuid::generate(),
]
]
);
}
];