helpers\BaseInflector sentence()

sentence() public static method (available since version 2.0.1) Converts a list of words into a sentence. Special treatment is done for the last few words. For example, $words = ['Spain', 'France']; echo Inflector::sentence($words); // output: Spain and France $words = ['Spain', 'France', 'Italy']; echo Inflector::sentence($words); // output: Spain, France and Italy $words = ['Spain', 'France', 'Italy']; echo Inflector::sentence($words, ' & '); // output: Spain, France & Italy

helpers\BaseInflector pluralize()

pluralize() public static method Converts a word to its plural form. Note that this is for English only! For example, 'apple' will become 'apples', and 'child' will become 'children'. public static string pluralize ( $word )$word string The word to be pluralized return string The pluralized word

helpers\BaseInflector ordinalize()

ordinalize() public static method Converts number to its ordinal English form. For example, converts 13 to 13th, 2 to 2nd . .. public static string ordinalize ( $number )$number integer The number to get its ordinal value

helpers\BaseInflector id2camel()

id2camel() public static method Converts an ID into a CamelCase name. Words in the ID separated by $separator (defaults to '-') will be concatenated into a CamelCase name. For example, 'post-tag' is converted to 'PostTag'. public static string id2camel ( $id, $separator = '-' )$id string The ID to be converted $separator string The character used to separate the words in the ID return string The resulting CamelCase name

helpers\BaseInflector humanize()

humanize() public static method Returns a human-readable string from $word public static string humanize ( $word, $ucAll = false )$word string The string to humanize $ucAll boolean Whether to set all words to uppercase or not

helpers\BaseInflector hasIntl()

hasIntl() protected static method protected static boolean hasIntl ( )return boolean If intl extension is loaded

helpers\BaseInflector classify()

classify() public static method Converts a table name to its class name. For example, converts "people" to "Person" public static string classify ( $tableName )$tableName string

helpers\BaseInflector camelize()

camelize() public static method Returns given word as CamelCased Converts a word like "send_email" to "SendEmail". It will remove non alphanumeric character from the word, so "who's online" will be converted to "WhoSOnline" See also variablize(). public static string camelize ( $word )$word string The word to CamelCase

helpers\BaseInflector camel2words()

camel2words() public static method Converts a CamelCase name into space-separated words. For example, 'PostTag' will be converted to 'Post Tag'. public static string camel2words ( $name, $ucwords = true )$name string The string to be converted $ucwords boolean Whether to capitalize the first letter in each word return string The resulting words

helpers\BaseInflector camel2id()

camel2id() public static method Converts a CamelCase name into an ID in lowercase. Words in the ID may be concatenated using the specified character (defaults to '-'). For example, 'PostTag' will be converted to 'post-tag'. public static string camel2id ( $name, $separator = '-', $strict = false )$name string The string to be converted $separator string The character used to concatenate the words in the ID $strict boolean|string Whether to insert a separator between two consecutive