Skip to content
Umakant Patil edited this page Aug 14, 2017 · 2 revisions

Capitalizes the first letter of all words in a variable. This is similar to the PHP ucwords() function.

Parameter Position Type Required Default Description
1 boolean No false This determines whether or not words with digits will be uppercased
2 boolean No false This determines whether or not Capital letters within words should be lowercased, e.g. "aAa" to "Aaa"
{$articleTitle = 'next x-men film, x3, delayed.'}

{$articleTitle}                     // next x-men film, x3, delayed.
{$articleTitle|capitalize}          // Next X-Men Film, x3, Delayed.
{$articleTitle|capitalize:true}     // Next X-Men Film, X3, Delayed.
Clone this wiki locally