Q
Q
Qairat2016-12-28 06:49:23
Bootstrap
Qairat, 2016-12-28 06:49:23

How to make active class when category is selected?

Good afternoon
I made a category list like this:

<div class="panel-heading">
        <h4 class="panel-title">
          <a data-toggle="collapse" href="#collapse2">Электрика</a>
        </h4>
      </div>
      <div id="collapse2" class="panel-collapse collapse">
        <ul class="list-group">
        <?php foreach ($categories2 as $categoryItem): ?>
          <li class="list-group-item">
            <a href="/category2/<?php echo $categoryItem['id'];?>">
        <?php echo $categoryItem['name'];?>
            </a>
          </li>
        <?php endforeach; ?>
        </ul>
      </div>

And it is displayed like this:
62e4403b8cae4761be9b288d19b524d9.png
You click on the electrician and a list of categories drops out.
Now I can not do when choosing a category, so that this category stands out.
How to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Savrasov, 2016-12-28
@alcorn

If it's pure php, then try using.
$_SERVER['REQUEST_URI']

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question