';
}
$nav = '';
$nav .= '';
Components::set( $breadcrumb_component, $nav );
}
/**
* This function parses either given html or the current page content and sets
* the current active page to selected within an html list.
*
* @param string $menu - The name of the view you wish to add. can be any arbitrary value if $view is provided.
* @param string $selectString - The string/url you are searching for, default model/controller is used if none is provided.
* @param string $view - The html you want parsed, view is generated from menu name if $view is left blank
* @return string|bool - returns bool if the menu was added to the page content or
* returns the parsed view if one was provided with the
* function call.
*/
public static function activePageSelect( $menu, $selectString = null, $addToContent = false, $use_included_html = false ) {
$regSelect = null;
if ( false === $use_included_html ) {
$view = Views::simpleView( $menu );
} else {
$view = $menu;
}
if ( $selectString == null ) {
$selectString = ltrim( Routes::getUri(false), '/' );
}
$explodedUrl = explode( '/', $selectString );
$variations = [
Routes::getRequestUrl(),
Routes::getUri(),
Routes::getUri(false),
Routes::getAddress() . $selectString,
Routes::getAddress() . $explodedUrl[0],
'/' . $selectString,
$selectString,
$explodedUrl[0],
'/' . $explodedUrl[0],
'/' . $explodedUrl[0] . '/',
$explodedUrl[0] . '/index',
'/' . $explodedUrl[0] . '/index',
'/' . $explodedUrl[0] . '/index/',
];
foreach ( $variations as $url ) {
$regex = "#(.*)