summaryrefslogtreecommitdiff
path: root/public/app/views/components/breadcrumbs.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-27 03:47:30 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-27 03:47:30 +0300
commit059e0d95d0c28bc5060e87e146eaf7411f51bf90 (patch)
tree7c21ac432f16dde2329a0d5954d70711eceb48e6 /public/app/views/components/breadcrumbs.php
parent26cd8ee99659ef1926c96a049c93645ffc9b169d (diff)
downloadgyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.gz
gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.bz2
gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.zip
skeleton commit; based on an anom project
Diffstat (limited to 'public/app/views/components/breadcrumbs.php')
-rw-r--r--public/app/views/components/breadcrumbs.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/public/app/views/components/breadcrumbs.php b/public/app/views/components/breadcrumbs.php
new file mode 100644
index 0000000..59c0fca
--- /dev/null
+++ b/public/app/views/components/breadcrumbs.php
@@ -0,0 +1,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> \ No newline at end of file