Files
coolcoth.com/app/Views/cases/show.php
T
2026-08-08 16:26:31 +08:00

36 lines
1.8 KiB
PHP

<?php
$c = $c ?? null;
$layoutArr = [];
if (!empty($c['layout'])) { $d = json_decode($c['layout'], true); if (is_array($d)) $layoutArr = $d; }
$hasCanvas = !empty($layoutArr);
?>
<section class="page-hero">
<div class="container">
<h1><?php echo e($c['title']); ?></h1>
<p><?php echo e(format_date($c['published_at'])); ?> · <?php echo e($c['customer'] ?? ''); ?> · <?php echo e($c['industry'] ?? ''); ?></p>
</div>
</section>
<div class="container">
<nav class="breadcrumb"><a href="<?php echo site_url(); ?>">首页</a> / <a href="<?php echo site_url('cases'); ?>">客户案例</a> / <?php echo e($c['title']); ?></nav>
</div>
<?php if ($hasCanvas): ?>
<?php echo \Core\View::buffer('parts/canvas', ['layout' => $layoutArr, 'item' => $c, 'module' => 'case']); ?>
<?php else: ?>
<section class="section" style="padding-top:10px">
<div class="container" style="max-width:780px">
<article class="detail-desc" style="font-size:16px"><?php echo e($c['content']); ?></article>
</div>
</section>
<?php endif; ?>
<section class="section" style="padding-top:0">
<div class="container" style="max-width:780px">
<div style="display:flex;justify-content:space-between;margin-top:40px;gap:12px;flex-wrap:wrap">
<?php if ($prev): ?><a class="btn btn-ghost" href="<?php echo site_url('cases/' . $prev['slug']); ?>">← <?php echo e(mb_substr($prev['title'],0,14)); ?></a><?php else: ?><span></span><?php endif; ?>
<?php if ($next): ?><a class="btn btn-ghost" href="<?php echo site_url('cases/' . $next['slug']); ?>"><?php echo e(mb_substr($next['title'],0,14)); ?> →</a><?php else: ?><span></span><?php endif; ?>
</div>
<div style="text-align:center;margin-top:30px"><a class="more-link" href="<?php echo site_url('cases'); ?>">返回案例列表</a></div>
</div>
</section>