Class Misago\ActiveSupport\String

Extensions for strings.

Inheritence

Extends:
Inflections

Protected static attributes

Methods

Public static methods

camelize($str)

Transforms to CamelText (eg: BlogComment).

humanize($str)

Capitalizes the first word and turns underscores into spaces and strips a trailing "_id".

pluralize($str)

Pluralizes a word.

singularize($str)

Singularizes a word.

slug($str, $strtolower=true)

Transforms a string to an URL style.

Changes spaces and non ascii chars to a dash, (but should preserve accented characters).

"This is a title" => "this-is-a-title" 

transliterate($str)

Replaces accented characters with their ascii equivalents. TODO: String::transliterate();

underscore($str)

Transforms to underscore_text (eg: blog_comment).

variablize($str)

Transforms to camelBacked style (eg: blogComment).