0
Well, I have the following code:
<body>
<?php
$server = $_SERVER['SERVER_NAME'];
$endereco = $_SERVER ['REQUEST_URI'];
?>
<!-- Menu principal -->
<nav class="navbar navbar-default">
<div class="container">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav pull-right">
<li><a href="#">Home</li>
<li><a href="#">Quem somos</a></li>
<li><a href="#">Loja</a></li>
<li><a href="#">Fale conosco</a></li>
</ul>
</div><!-- /.Colapso da navegação -->
</div>
</nav>
<!-- \.Menu principal -->
In this case, the URI
past is localhost/testes/index.php
, I would like to know if there is how, and how to do so, depending on what is passed on URI
, me adicionar
or remover
classes
specific elements in that navbar
. I searched through some questions with answers from stack
, but none of them gave me a light on how to do or where to start, so I’m opening this.
Just make conditions with PHP and echo the classes you want to add, if I understood what you wanted to do.
– Clayderson Ferreira