Smarty "capitalize" modifier... always capitalizes "L"? ... and "P"?

Lazlo picture Lazlo · Jun 22, 2011 · Viewed 8.2k times · Source

Quite simply: I'm using Smarty and the |capitalize modifier. It works fine, but when I pass any word with l in it, it capitalizes it, even if it's not at the beginning of the word.

What why?

EDIT: Same happens with p.

Test:

{"abcdefghijklmnopqrstuvwxyz"|capitalize}
{"aaal aala alaa laaa"|capitalize}
{"aaap aapa apaa paaa"|capitalize}

Output:

AbcdefghijkLmnoPqrstuvwxyz
AaaL AaLa ALaa Laaa
AaaP AaPa APaa Paaa

Answer

JochenJung picture JochenJung · Jun 27, 2011

You could also use PHP's ucfirst function

{"aaal aala alaa laaa"|@ucfirst}

This will result in

Aaal aala alaa laaa