Class TipyInflector
Transforms words from singular to plural, class names to table names, camelCase to snake_case, etc...
-
Inflect
-
TipyInflector
Methods summary
public static
string
|
#
underscore( string $str )
Transform string in camelCase to snake_case
Transform string in camelCase to snake_case
Deprecated
Parameters
Returns
string
|
public static
string
|
#
snakeCase( string $str )
Transform string in camelCase to snake_case
Transform string in camelCase to snake_case
Parameters
Returns
string
|
public static
string
|
#
titleCase( string $str )
Transform string in snake_case to TitleCase
Transform string in snake_case to TitleCase
Parameters
Returns
string
|
public static
string
|
#
camelCase( string $str )
Transform string in snake_case to camelCase
Transform string in snake_case to camelCase
Parameters
Returns
string
|
public static
string
|
#
classify( string $str )
Create a model class name from a plural table name.
Create a model class name from a plural table name.
TipyInflector::classify('blog_posts')
Parameters
Returns
string
|
public static
string
|
#
tableize( string $str )
Create plural table name from a model name.
Create plural table name from a model name.
TipyInflector::tableize('BlogPost')
Parameters
Returns
string
|
public static
string
|
#
controllerize( string $str )
Create name valid to be a part of controller name from snake_case string.
This method does not change plural/singular form of nouns.
Create name valid to be a part of controller name from snake_case string.
This method does not change plural/singular form of nouns.
TipyInflector::controllerize('blog_post')
TipyInflector::controllerize('blog_posts')
Parameters
Returns
string
|