视图与已准备数据
PublicSiteContext 提供站点、导航、语言与能力。首页可以缺失。详情获得清理后的 HTML 与 SEO;归档获得分页 items 和已准备 URL。Blade 渲染这些数据,不查询数据库。
视图与已准备数据
PublicSiteContext 提供站点、导航、语言与能力。首页可以缺失。详情获得清理后的 HTML 与 SEO;归档获得分页 items 和已准备 URL。Blade 渲染这些数据,不查询数据库。
应用示例
<h1>{{ $title }}</h1>
@if($summary)<p>{{ $summary }}</p>@endif
<div class="prose">{{ $body }}</div>
<?php
namespace Themes\Reference;
final class Labels implements \App\Core\Themes\ViewPresenter
{
public function present(string $view, array $data): array
{
return ['labels' => []];
}
}
相关阅读
概念片段:使用前补齐必需文件并注册呈现器。