Part on Superglobals finished
This commit is contained in:
parent
c80327424b
commit
a1e1a43d81
6 changed files with 19 additions and 4 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
require 'functions.php';
|
||||||
$heading = "About Us";
|
$heading = "About Us";
|
||||||
require "views/about.view.php";
|
require "views/about.view.php";
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
require 'functions.php';
|
||||||
$heading = "Contact Us";
|
$heading = "Contact Us";
|
||||||
require "views/contact.view.php";
|
require "views/contact.view.php";
|
||||||
11
functions.php
Normal file
11
functions.php
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
function dd($value) {
|
||||||
|
echo "<pre>";
|
||||||
|
var_dump($value);
|
||||||
|
echo "</pre>";
|
||||||
|
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
function urlIs($value) {
|
||||||
|
return $_SERVER['REQUEST_URI'] === $value;
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
require 'functions.php';
|
||||||
$heading = "Home";
|
$heading = "Home";
|
||||||
require "views/index.view.php";
|
require "views/index.view.php";
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
require 'functions.php';
|
||||||
$heading = "Mission";
|
$heading = "Mission";
|
||||||
require "views/mission.view.php";
|
require "views/mission.view.php";
|
||||||
|
|
@ -8,13 +8,13 @@
|
||||||
<div class="hidden md:block">
|
<div class="hidden md:block">
|
||||||
<div class="ml-10 flex items-baseline space-x-4">
|
<div class="ml-10 flex items-baseline space-x-4">
|
||||||
<!-- Current: "bg-gray-900 text-white", Default: "text-gray-300 hover:bg-gray-700 hover:text-white" -->
|
<!-- Current: "bg-gray-900 text-white", Default: "text-gray-300 hover:bg-gray-700 hover:text-white" -->
|
||||||
<a href="/" class="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Home</a>
|
<a href="/" class="<?= urlIs('/') ? 'bg-gray-900 text-white' : 'text-gray-300' ?> hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Home</a>
|
||||||
|
|
||||||
<a href="/about.php" class="bg-gray-900 text-white px-3 py-2 rounded-md text-sm font-medium" aria-current="page">About</a>
|
<a href="/about.php" class="<?= urlIs('/about.php') ? 'bg-gray-900 text-white' : 'text-gray-300' ?> hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium" >About</a>
|
||||||
|
|
||||||
<a href="/contact.php" class="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Contact</a>
|
<a href="/contact.php" class="<?= urlIs('/contact.php') ? 'bg-gray-900 text-white' : 'text-gray-300' ?> hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Contact</a>
|
||||||
|
|
||||||
<a href="/mission.php" class="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Our Mission</a>
|
<a href="/mission.php" class="<?= urlIs('/mission.php') ? 'bg-gray-900 text-white' : 'text-gray-300' ?> hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Our Mission</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue