(string) hyphenaged ($haystack, [$asVendorPrefix = false])
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"