summaryrefslogtreecommitdiff
path: root/public/app/views/components/breadcrumbs.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-17 12:12:22 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-17 12:12:22 +0300
commit68fc9e55e538e03f94509731ab41a0c8cf96710f (patch)
tree3edb1e81864ac3eb35ba0fe8087ed24da1b812bf /public/app/views/components/breadcrumbs.php
parent84b2da85a1b452922dadb6a609533b9945afe51d (diff)
downloadclassroom-68fc9e55e538e03f94509731ab41a0c8cf96710f.tar.gz
classroom-68fc9e55e538e03f94509731ab41a0c8cf96710f.tar.bz2
classroom-68fc9e55e538e03f94509731ab41a0c8cf96710f.zip
setup a real server environment (apache DocumentRoot=/var/www/public)
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..471cfb6
--- /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 $title : 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="/wiki/category?id=<?=$node['id']?>"><?=$node['title']?></a>
+ <?php endforeach; ?>
+ <?php endif; ?>
+
+ <!-- last (current) node -->
+ <?php if ($id != 0) : ?>
+ <i class="fas fa-angle-right"></i> <a href="/wiki/category?id=<?=$id?>"><?=$title?></a>
+ <?php endif; ?>
+
+</div> \ No newline at end of file