Centralize domain stats retrieval in LayoutHelper

Moved domain statistics logic into a new LayoutHelper::getDomainStats() method. Updated base layout and dashboard view to use this helper, reducing code duplication and improving maintainability.
This commit is contained in:
Hosteroid
2025-10-20 18:44:03 +03:00
parent 7ad01a7da0
commit e448855687
3 changed files with 24 additions and 10 deletions

View File

@@ -3,6 +3,12 @@ $title = 'Dashboard';
$pageTitle = 'Dashboard Overview';
$pageDescription = 'Monitor your domains and expiration dates';
$pageIcon = 'fas fa-chart-line';
// Get stats for dashboard (if not already set by base.php)
if (!isset($stats)) {
$stats = \App\Helpers\LayoutHelper::getDomainStats();
}
ob_start();
?>
@@ -262,7 +268,6 @@ ob_start();
</div>
</div>
<?php
$content = ob_get_clean();
include __DIR__ . '/../layout/base.php';