library/Garp/Util/String.php
static public function camelcasedToDashed($str) {
        $str = lcfirst($str);
        return preg_replace_callback(
            '/([A-Z])/',
            function ($str) {
                return "-" . strtolower($str[1]);
            },
            $str
        );
    }
static public function camelcasedToDashed($str) {
        $str = lcfirst($str);
        return preg_replace_callback(
            '/([A-Z])/',
            function ($str) {
                return "-" . strtolower($str[1]);
            },
            $str
        );
    }
static public function camelcasedToDashed ( $ str ) { $ str = lcfirst ( $ str ) ; return preg_replace_callback ( '/([A-Z])/' , function ( $ str ) { return "-" . strtolower ( $ str [ 1 ] ) ; } , $ str ) ; }
Converts 'SnoopDoggyDog' to 'snoop-doggy-dog'

@param string $str
@return string
Converts SnoopDoggyDog to snoop - doggy - dog