$page_name";
}
}
if(!empty($navigation_pages)){
$default_page = $routerConfig["default_page"];
$navsite_attributes = "data-page='$default_page' data-site='$site_dir'";
$nav_out .= "$site_name";
}
}
return str_replace("__NAV_PAGES__", $nav_out, $nav);
}
/**
* Provides a simple API endpoint-like response for fetching generated navigation HTML.
* Wraps generateNavigation for an API.
*
* @return array Returns an associative array with the navigation HTML and a status indicating success.
*/
function getNavigationEndpoint() :array{
return [
"Status" => "Success",
"Navigation" => generateNavigation(),
];
}