public function formatUrl($string)
        {
            // Allow only alphanumerics, underscores and dashes
            $string = preg_replace('/([^a-zA-Z0-9_\-]+)/', '-', strtolower($string));
            // Replace extra spaces and dashes with single dash
            $string = preg_replace('/\s+/', '-', $string);
            $string = preg_replace('|-+|', '-', $string);
            // Trim extra dashes from beginning and end
            $string = trim($string, '-');

            return $string;
        }