Skip to content

Global Helpers

capitalize()

capitalize() — returns string

Available in: controller, model, mapper, migrator, migration, tabledefinition Category: String Functions

Capitalizes the first character of the supplied string.

NameTypeRequiredDefaultDescription
textstringyes—String to capitalize.
// 1. Capitalize the first character of a sentence
result = capitalize("wheels is a framework");
// result -> "Wheels is a framework"

// 2. Capitalize a lowercase word
result = capitalize("hello");
// result -> "Hello"

// 3. Returns an already-capitalized string unchanged
result = capitalize("CFWheels");
// result -> "CFWheels"