Class: \Conifer\Twig\TextHelper
Twig Wrapper for helpful linguistic filters, such as pluralize
Visibility | Function |
---|---|
public | capitalize_each(\string $phrase, array $options=array())</strong> : the capitalized string, e.g. "The Old Man and the Sea" Capitalize each word in the given $phrase, other than "small" words such as "a," "the," etc. - small_words : words not to capitalize. Defaults to the normal rules of the English language. - split_by : the delimiter for splitting out words when calling explode() . Defaults to a single space, i.e. " " . |
public | get_filters() : array an associative array of callback functions, keyed by name Get the Twig functions to register |
public | get_functions() : array Does not supply any additional Twig functions. |
public | oxford_comma(array $items)</strong> : string Returns a human-readable list of things. Uses the Oxford comma convention for listing three or more things. |
public | pluralize(string $noun, int $n)</strong> : string the noun, pluralized or not according to $n Pluralize the given noun, if $n is anything other than 1 |
This class implements \Conifer\Twig\HelperInterface