(string) hyphenaged ($haystack, [$asVendorPrefix = false])
Hyphenate compound words from camelCase/StudlyCaps.
Parameters:
name | type | default | caption |
---|---|---|---|
$haystack | string | String to Convert. | |
$asVendorPrefix | boolean | false | Treat as vendor-prefix (CSS). |
Returns:
- (string) — Hyphenaged String.
Author:
- StewEucen
Since:
- Version 1.0.0
Aliases:
- trainCase
- chainCase
- kebabCase
- spinalCase
Examples:
use StewEucen\Acts\IntactCase
IntactCase::hyphenaged('chainCase') //=> "chain-case"
IntactCase::hyphenaged('VendorPrefix', true) //=> "-vendor-prefix"
IntactCase::hyphenaged('camelCase', true) //=> "camel-case"