Helper\Utils::menuActive PHP Method

menuActive() public static method

public static menuActive ( $link = "", $args = "" )
    public static function menuActive($link = "", $args = "")
    {
        $requestPath = \Core\Request::getRequestPath();
        $controllerName = ucfirst(substr($requestPath, strrpos($requestPath, "/")));
        if (strpos($link, '|') !== false) {
            $links = explode('|', $link);
            $arg = "";
            for ($i = 0; $i < count($links); $i++) {
                if (stripos($controllerName, $links[$i]) !== false) {
                    $arg = 'active ' . $args;
                    break;
                }
            }
            return $arg;
        }
        if (stripos($requestPath, $link) !== false) {
            return 'active ' . $args;
        } else {
            return "";
        }
    }