Are there any best practices that should be followed when creating a navigation function in PHP classes?

When creating a navigation function in PHP classes, it is important to follow best practices to ensure the code is clean, maintainable, and efficient. Some best practices include using clear and descriptive method names, separating concerns by creating separate methods for different navigation functionalities, and avoiding hardcoding URLs or routes in the class.

class Navigation {
    public function generateMenu() {
        // code to generate menu items
    }

    public function generateSubMenu() {
        // code to generate sub-menu items
    }

    public function isActive($url) {
        // code to check if a given URL is active
    }
}