/** * Traverses through the node path to fetch the location of the current navigation access point. */ public static function get_node_path() { // Initialize variables $node_path = array(); // Initialize the `midcom_helper_nav` class $nap = new midcom_helper_nav(); // Get nodes $node_path = $nap->get_node_path(); $leaf = $nap->get_current_leaf(); // If NAP offers a leaf it should be stored in the node path if ($leaf) { $node_path[] = $leaf; } return $node_path; }