class Inflector (View source)

Inflector utilities for the Kickstarter. This is a basic conversion from PHP class and field names to a human readable form.

Methods

string
pluralize(string $word)

No description

string
humanizeCamelCase(string $camelCased, bool $lowercase = false)

Convert a model class name like "BlogAuthor" or a field name like "blogAuthor" to a humanized version like "Blog author" for better readability.

string
spacify(string $camelCased, string $glue = ' ')

Splits a string at lowercase/uppcase transitions and insert the glue character in between.

Details

string pluralize(string $word)

No description

Parameters

string $word

The word to pluralize

Return Value

string

The pluralized word

string humanizeCamelCase(string $camelCased, bool $lowercase = false)

Convert a model class name like "BlogAuthor" or a field name like "blogAuthor" to a humanized version like "Blog author" for better readability.

Parameters

string $camelCased

The camel cased value

bool $lowercase

Return lowercase value

Return Value

string

The humanized value

protected string spacify(string $camelCased, string $glue = ' ')

Splits a string at lowercase/uppcase transitions and insert the glue character in between.

Parameters

string $camelCased
string $glue

Return Value

string