Phactory\Inflector::titleize PHP Метод

titleize() публичный Метод

The titleize function converts text like "WelcomePage", "welcome_page" or "welcome page" to this "Welcome Page". If second parameter is set to 'first' it will only capitalize the first character of the title.
public titleize ( string $word, string $uppercase = '' ) : string
$word string Word to format as tile
$uppercase string If set to 'first' it will only uppercase the first character. Otherwise it will uppercase all the words in the title.
Результат string Text formatted as title
    function titleize($word, $uppercase = '')
    {
        $uppercase = $uppercase == 'first' ? 'ucfirst' : 'ucwords';
        return $uppercase(Inflector::humanize(Inflector::underscore($word)));
    }