Global Helpers
hyphenize()
Signature
Section titled “Signature”hyphenize() — returns string
Available in: controller, model, mapper, migrator, migration, tabledefinition
Category: String Functions
Description
Section titled “Description”Converts camelCase strings to lowercase strings with hyphens as word delimiters instead. Example: myVariable becomes my-variable.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
string | string | yes | — | The string to hyphenize. |
Examples
Section titled “Examples”// 1. Basic camelCase to hyphenated string
result = hyphenize("myBlogPost");
// result -> "my-blog-post"
// 2. Single word (no change)
result = hyphenize("hello");
// result -> "hello"
// 3. Used in URL slug generation
slug = hyphenize("userProfileSettings");
// slug -> "user-profile-settings"