Administration/views/main/view.admin.cache.php

32 lines
988 B
PHP
Raw Normal View History

<?php
namespace Application\View;
use Application\Controller\CacheController;
use FuzeWorks\Administration\AdminView;
use FuzeWorks\Administration\Attributes\DisplayAttribute;
use FuzeWorks\Administration\Attributes\HiddenAttribute;
use FuzeWorks\Administration\Attributes\IconAttribute;
use FuzeWorks\Administration\Attributes\PermissionAttribute;
use FuzeWorks\Administration\Attributes\PriorityAttribute;
use FuzeWorks\Controller;
use FuzeWorks\Factory;
use FuzeWorks\ObjectStorage\ObjectStorageComponent;
use FuzeWorks\Priority;
use Psr\SimpleCache\CacheInterface;
class CacheAdminView extends AdminView
{
/** @var CacheController $controller */
protected Controller $controller;
#[DisplayAttribute("ObjectStorage"), IconAttribute("server"), PriorityAttribute(Priority::LOW)]
#[HiddenAttribute]
#[PermissionAttribute(["ADMIN"])]
public function index()
{
$items = $this->controller->getCacheItems();
return json_encode($items);
}
}