Refactor: snake_case → camelCase dans blueprints, templates et vues
- Blueprints : renommage des champs (member_name, related_articles, background_video, play_links, images_gallery, external_links) et des noms de sections - Templates JSON PHP : clés de sortie et appels ->method() en camelCase - Vues Svelte (Play, Portfolio) : accès aux données alignés Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d8a0fde34c
commit
69859cc60f
19 changed files with 63 additions and 76 deletions
|
|
@ -1,21 +1,21 @@
|
|||
<?php
|
||||
|
||||
$related = $page->related_articles()->toPages();
|
||||
$related = $page->relatedArticles()->toPages();
|
||||
if ($related->isEmpty()) {
|
||||
$related = $page->siblings()->listed()->not($page)->shuffle()->limit(3);
|
||||
}
|
||||
|
||||
$specificData = [
|
||||
'date' => $page->date()->toDate('Y-m-d'),
|
||||
'date_formatted' => $page->date()->toDate('d/m/Y'),
|
||||
'dateFormatted' => $page->date()->toDate('d/m/Y'),
|
||||
'intro' => $page->intro()->value(),
|
||||
'author' => [
|
||||
'name' => $page->author_name()->value(),
|
||||
'role' => $page->author_role()->value(),
|
||||
'photo' => $page->author_photo()->toFile()?->url()
|
||||
'name' => $page->authorName()->value(),
|
||||
'role' => $page->authorRole()->value(),
|
||||
'photo' => $page->authorPhoto()->toFile()?->url()
|
||||
],
|
||||
'cover' => $page->cover()->toFile()?->url(),
|
||||
'content' => $page->article_content()->toBlocks(),
|
||||
'content' => $page->articleContent()->toBlocks(),
|
||||
'tags' => $page->tags()->split(),
|
||||
'related' => $related->map(function($rec) {
|
||||
return [
|
||||
|
|
@ -25,7 +25,7 @@ $specificData = [
|
|||
'cover' => $rec->cover()->toFile()?->thumb(['width' => 400])->url()
|
||||
];
|
||||
})->values(),
|
||||
'parent_url' => $page->parent()->url()
|
||||
'parentUrl' => $page->parent()->url()
|
||||
];
|
||||
|
||||
$pageData = array_merge($genericData, $specificData);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue