Files
kiri-router/examples/user/profile.blade.php
T

55 lines
1.3 KiB
PHP
Raw Normal View History

2025-12-01 06:39:04 +08:00
@extends('layouts.app')
@section('title')
用户资料 - Kiri Blade
@endsection
@section('header')
用户资料页面
@endsection
@section('content')
<h2>用户信息</h2>
@if(isset($name))
<p><strong>姓名:</strong>{{ $name }}</p>
@else
<p>姓名未设置</p>
@endif
@if(isset($email))
<p><strong>邮箱:</strong>{{ $email }}</p>
@endif
@if(isset($age))
<p><strong>年龄:</strong>{{ $age }} </p>
@endif
<h3>技能列表</h3>
@if(isset($skills) && is_array($skills))
<ul>
@foreach($skills as $skill)
<li>{{ $skill }}</li>
@endforeach
</ul>
@else
<p>暂无技能</p>
@endif
<h3>文章列表</h3>
@if(isset($posts) && is_array($posts))
<div>
@foreach($posts as $post)
<div style="border: 1px solid #ddd; padding: 10px; margin: 10px 0;">
<h4>{{ $post['title'] ?? '无标题' }}</h4>
<p>{{ $post['content'] ?? '无内容' }}</p>
<small>发布时间:{{ $post['date'] ?? '未知' }}</small>
</div>
@endforeach
</div>
@else
<p>暂无文章</p>
@endif
@endsection