No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

59 líneas
2.3KB

  1. <?php
  2. declare(strict_types=1);
  3. use Cartalyst\Sentinel\Native\Facades\Sentinel;
  4. $navigationItems = [
  5. ['label' => 'Home', 'href' => '/'],
  6. ['label' => 'Territories', 'href' => '/territories'],
  7. ['label' => 'Households', 'href' => '/households'],
  8. ['label' => 'Householder Names', 'href' => '/householder-names'],
  9. ['label' => 'Export', 'href' => '/export'],
  10. ];
  11. $currentPath = parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH);
  12. $currentPath = is_string($currentPath) && $currentPath !== '' ? $currentPath : '/';
  13. $currentUser = Sentinel::check();
  14. ?>
  15. <!DOCTYPE html>
  16. <html lang="en">
  17. <head>
  18. <meta charset="UTF-8">
  19. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  20. <title><?= e($pageTitle ?? 'MindVisionCode PHP') ?></title>
  21. <link rel="stylesheet" href="<?= e(asset('css/site.css')) ?>">
  22. </head>
  23. <body>
  24. <div class="page-shell">
  25. <header class="site-header">
  26. <div class="container header-inner">
  27. <a class="brand" href="/">
  28. <span class="brand-mark">MV</span>
  29. <span class="brand-copy">
  30. <strong>MindVisionCode</strong>
  31. <small>PHP MVC</small>
  32. </span>
  33. </a>
  34. <nav class="site-nav" aria-label="Primary navigation">
  35. <?php foreach ($navigationItems as $item): ?>
  36. <?php $isActive = $currentPath === $item['href']; ?>
  37. <a class="nav-link<?= $isActive ? ' is-active' : '' ?>" href="<?= e($item['href']) ?>">
  38. <?= e($item['label']) ?>
  39. </a>
  40. <?php endforeach; ?>
  41. <?php if ($currentUser): ?>
  42. <form class="auth-nav-form" method="POST" action="/logout">
  43. <?= csrf_field() ?>
  44. <button class="auth-nav-btn" type="submit">Sign out</button>
  45. </form>
  46. <?php else: ?>
  47. <a class="nav-link<?= $currentPath === '/login' ? ' is-active' : '' ?>" href="/login">Sign in</a>
  48. <?php endif; ?>
  49. </nav>
  50. </div>
  51. </header>

Powered by TurnKey Linux.