17 lines
630 B
PHP
17 lines
630 B
PHP
<?php
|
|
use App\Content\View;
|
|
|
|
$e = View::escape(...);
|
|
?>
|
|
<?php if ($visitor): ?>
|
|
<a class="site-account" href="/account" aria-label="打开用户中心">
|
|
<?php if ($visitor['avatar'] !== ''): ?>
|
|
<img class="account-avatar" src="<?= $e($visitor['avatar']) ?>" alt="" width="36" height="36">
|
|
<?php else: ?>
|
|
<span class="account-avatar account-initial" aria-hidden="true"><?= $e(mb_substr($visitor['name'], 0, 1)) ?></span>
|
|
<?php endif ?>
|
|
</a>
|
|
<?php else: ?>
|
|
<a class="button button-outline site-account" href="/account/login/<?= $e($layoutId) ?>">登录</a>
|
|
<?php endif ?>
|