File menu.php
:
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"><img src="/imagens/logo.png"></a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</div>
</nav>
Let's say I have to add the menu in every * .php where there is a need for the page to have the menu, the best way is to do an include? For example:
- Suppose we are in the root directory and we are in index.php of this same directory, my
include
would be in this path:include_once("Templates/menu.php");
Now, if I create a directory named home
and create a index.php
inside it (home / index.php), the path of include
above would be: include_once("../Templates/menu.php");
, which would work hard.
Is there any simplified way to make an include of menu
, footer
etc more "expert"?
I was thinking of doing in OOP
.