/** * Returns a capitalized string. * * @param Apishka_Templater_Environment $env A Apishka_Templater_Environment instance * @param string $string A string * * @return string The capitalized string */ function twig_capitalize_string_filter(Apishka_Templater_Environment $env, $string) { $charset = $env->getCharset(); return mb_strtoupper(mb_substr($string, 0, 1, $charset), $charset) . mb_strtolower(mb_substr($string, 1, 2147483647, $charset), $charset); }