Download src/Presentation/RequestHandlers/Admin/DashboardView.php from pnacorp/AIKEEDO: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Presentation/RequestHandlers/Admin/DashboardView.php
- Command line
-
hf download hf://pnacorp/AIKEEDO/src/Presentation/RequestHandlers/Admin/DashboardView.php
-
curl -L -o DashboardView.php https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Presentation/RequestHandlers/Admin/DashboardView.php
1.02 kB
| declare(strict_types=1); | |
| namespace Presentation\RequestHandlers\Admin; | |
| use Billing\Application\Commands\CountPlansCommand; | |
| use Easy\Http\Message\RequestMethod; | |
| use Easy\Router\Attributes\Route; | |
| use Presentation\Response\ViewResponse; | |
| use Psr\Http\Message\ResponseInterface; | |
| use Psr\Http\Message\ServerRequestInterface; | |
| use Psr\Http\Server\RequestHandlerInterface; | |
| use Shared\Infrastructure\CommandBus\Dispatcher; | |
| (path: '/[dashboard]?', method: RequestMethod::GET) | |
| class DashboardView extends AbstractAdminViewRequestHandler implements | |
| RequestHandlerInterface | |
| { | |
| public function __construct( | |
| private Dispatcher $dispatcher | |
| ) { | |
| } | |
| public function handle(ServerRequestInterface $request): ResponseInterface | |
| { | |
| $cmd = new CountPlansCommand(); | |
| $count = $this->dispatcher->dispatch($cmd); | |
| return new ViewResponse( | |
| '/templates/admin/dashboard.twig', | |
| [ | |
| 'plans_count' => $count | |
| ] | |
| ); | |
| } | |
| } | |