初始化
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
|
||||
|
||||
$__newAttributes = [];
|
||||
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['user' => null]));
|
||||
|
||||
foreach ($attributes->all() as $__key => $__value) {
|
||||
if (in_array($__key, $__propNames)) {
|
||||
$$__key = $$__key ?? $__value;
|
||||
} else {
|
||||
$__newAttributes[$__key] = $__value;
|
||||
}
|
||||
}
|
||||
|
||||
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
|
||||
|
||||
unset($__propNames);
|
||||
unset($__newAttributes);
|
||||
|
||||
foreach (array_filter((['user' => null]), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
|
||||
$$__key = $$__key ?? $__value;
|
||||
}
|
||||
|
||||
$__defined_vars = get_defined_vars();
|
||||
|
||||
foreach ($attributes->all() as $__key => $__value) {
|
||||
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
|
||||
}
|
||||
|
||||
unset($__defined_vars, $__key, $__value); ?>
|
||||
|
||||
<?php if($user): ?>
|
||||
<?php $l = $user->level(); ?>
|
||||
<span class="inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-semibold <?php if($l <= 1): ?> bg-surface-2 text-muted <?php elseif($l === 2): ?> bg-info-soft text-info <?php elseif($l === 3): ?> bg-primary-soft text-primary <?php elseif($l === 4): ?> bg-warning-soft text-warning <?php else: ?> bg-danger-soft text-danger <?php endif; ?>" title="会员等级 L<?php echo e($l); ?>">
|
||||
L<?php echo e($l); ?> <?php echo e($user->levelName()); ?>
|
||||
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<?php /**PATH /www/wwwroot/cloud-chip.cn/resources/views/components/level-badge.blade.php ENDPATH**/ ?>
|
||||
Reference in New Issue
Block a user