The Cusp of Helix

Intact Case リファレンス
[hyphenaged]

(string) hyphenaged ($haystack, [$asVendorPrefix = false])

camelCase や StudlyCaps の文字列を、ハイフン区切り記法に変換します。

Parameters:

nametypedefaultcaption
$haystackstringString to Convert.
$asVendorPrefixbooleanfalseTreat 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"