summaryrefslogtreecommitdiff
path: root/public/app/views/components/breadcrumbs.php
blob: 59c0fcae83de50e96ff7023a0229d0fb8a430947 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php 
/** breadcrumbs
 * -----------------------------------------------------------------------------
 * 
 * imported variables
 * ---
 * @param $id : category_id of last level
 * @param $label : category title of last level
 * @param $parents : array of parent nodes
 * -----------------------------------------------------------------------------
 */

?>
<div class="breadcrumb">
    <!-- home -->
    <a href="/">Classroom</a>

    <!-- parent nodes -->
    <?php if ($id != 0) : ?>
        <?php foreach($parents as $node) : ?>
            <i class="fas fa-angle-right"></i> <a href="/course/<?=$node['id']?>"><?=$node['label']?></a>
        <?php endforeach; ?>
    <?php endif; ?>

    <!-- last (current) node -->
    <?php if ($id != 0) : ?>
        <i class="fas fa-angle-right"></i> <a href="/course/<?=$id?>"><?=$label?></a>
    <?php endif; ?>
    
</div>