What are the best practices for organizing and structuring navigation data in PHP for a flat-file MiniCMS to ensure ease of maintenance and scalability?

The best practices for organizing and structuring navigation data in PHP for a flat-file MiniCMS to ensure ease of maintenance and scalability include using an array to store navigation items, separating navigation data from the presentation logic, and creating reusable functions for rendering navigation menus.

// Define navigation items in an array
$navigationItems = [
    ['title' => 'Home', 'url' => '/'],
    ['title' => 'About', 'url' => '/about'],
    ['title' => 'Services', 'url' => '/services'],
    ['title' => 'Contact', 'url' => '/contact'],
];

// Function to render navigation menu
function renderNavigation($items) {
    $output = '<ul>';
    foreach ($items as $item) {
        $output .= '<li><a href="' . $item['url'] . '">' . $item['title'] . '</a></li>';
    }
    $output .= '</ul>';
    return $output;
}

// Usage example
echo renderNavigation($navigationItems);