php-nav
Installation:
- Put
navbar.phpinto the folder where you plan to include it. - Add
<link rel="stylesheet" href="https://cdn.harry.ml/php-nav/v1/php-nav-css.css">to the head tag. - After the body tag of your PHP document add:
<?php
include "navbar.php";
?>- Congrats! You have installed
php-nav
How to usephp-nav:
- Set a header:
// Navbar Header
$navH1 = "Header";- Set the amount of links you want to
true(I want 3 for this example), So I would do:
$navbarLink1 = true;
$navbarLink2 = true;
$navbarLink3 = true;
$navbarLink4 = false;- Set the text and location for your active navbar links:
// Link 1
$navbarLink1href = "https://example.com/1";
$navbarLink1text = "Example 1";
// Link 2
$navbarLink2href = "https://example.com/2";
$navbarLink2text = "Example 2";
// Link 3
$navbarLink3href = "https://example.com/3";
$navbarLink3text = "Example 3";- Now once you've done that put anything else you want on your page in a
divcontainer with the classphp-nav-container, in example:
<div class="php-nav-container">
<h1>PHP Navbar</h1>
<p>An example of PHP Navbar</p>
</div>5.That's it
view this example live at: https://php-nav.harry.ml
Important Information
Version: 0.1
Status: Stable