-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
55 lines (50 loc) · 1.67 KB
/
Copy pathtest.php
File metadata and controls
55 lines (50 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Template/Layout file for reusable page structure
* Usage example:
*
* $title = 'Page Title';
* $content = 'path/to/content.php';
* Note: Sidebar is always included as an overlay (no need to set $show_sidebar)
* $main_class = 'custom-class'; // optional
* $additional_scripts = ['js/custom.js']; // optional
* include 'layout.php';
*/
// Set default values if not provided
$title = $title ?? 'Gradify';
$content = $content ?? '';
// Sidebar is always included as an overlay - no need for $show_sidebar variable
$main_class = $main_class ?? 'min-h-screen';
$additional_scripts = $additional_scripts ?? [];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= htmlspecialchars($title) ?></title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-white text-slate-600 font-normal">
<?php include 'header.php'; ?>
<!-- Sidebar Component -->
<!-- Always included as an overlay sidebar that can be toggled open/closed -->
<?php include 'sidebar.php'; ?>
<main class="<?= htmlspecialchars($main_class) ?>">
<?php
if (is_string($content) && file_exists($content)) {
include $content;
} else {
echo $content;
}
?>
</main>
<?php include 'footer.php'; ?>
<!-- JavaScript for interactive components -->
<script src="js/mobile-menu.js"></script>
<script src="js/sidebar.js"></script>
<?php foreach ($additional_scripts as $script): ?>
<script src="<?= htmlspecialchars($script) ?>"></script>
<?php endforeach; ?>
</body>
</html>