SproutCMS

This is the code documentation for the SproutCMS project

class NavigationMenu

Renders a menu for the page node structure

If you would like to edit this, it would be much wiser to sub-class it
and override the various methods

Extending this class

<?php
/**
* New class description goes here
* 
* @author Your Name, 2024-05-03
**/
class NewClassName extends NavigationMenu {
    
    /**
    * Return HTML for a drop-down sub menu
    **/
    protected function subMenu (Treenode $parent_node, array $groups, Treenode $selected_node, array $selected_ancestors) {
        // Method code goes here
    }
    
    /**
    * Determine the classes for the LI for a navigation item
    **/
    public function determineClasses (Treenode $node, int $depth, int $index, Treenode $selected_node, array $selected_ancestors, bool $has_children) {
        // Method code goes here
    }
    
    /**
    * Return HTML for the home page nav item
    * This would typically be a LI
    **/
    protected function home () {
        // Method code goes here
    }
    
    /**
    * Return HTML for a mega menu.
    * 
    * You shouldn't need to modify or extend this method;
    * If you do then your use case is probably too bespoke for this class.
    **/
    public function render () {
        // Method code goes here
    }
    
}
?>