Normalise
Joomla Framework String Normalise Class
since |
1.0 |
---|
Methods
fromCamelCase
Method to convert a string from camel case.
fromCamelCase(string $input, boolean $grouped = false) : string
This method offers two modes. Grouped allows for splitting on groups of uppercase characters as follows:
"FooBarABCDef" becomes array("Foo", "Bar", "ABC", "Def") "JFooBar" becomes array("J", "Foo", "Bar") "J001FooBar002" becomes array("J001", "Foo", "Bar002") "abcDef" becomes array("abc", "Def") "abc_defGhi_Jkl" becomes array("abc_def", "Ghi_Jkl") "ThisIsA_NASAAstronaut" becomes array("This", "Is", "A_NASA", "Astronaut")) "JohnFitzgerald_Kennedy" becomes array("John", "Fitzgerald_Kennedy"))
Non-grouped will split strings at each uppercase character.
since |
1.0 |
---|
Arguments
- $input
string
The string input (ASCII only).- $grouped
boolean
Optionally allows splitting on groups of uppercase characters.
Response
string
The space separated string.
toCamelCase
Method to convert a string into camel case.
toCamelCase(string $input) : string
since |
1.0 |
---|
Arguments
- $input
string
The string input (ASCII only).
Response
string
The camel case string.
toDashSeparated
Method to convert a string into dash separated form.
toDashSeparated(string $input) : string
since |
1.0 |
---|
Arguments
- $input
string
The string input (ASCII only).
Response
string
The dash separated string.
toKey
Method to convert a string into key form.
toKey(string $input) : string
since |
1.0 |
---|
Arguments
- $input
string
The string input (ASCII only).
Response
string
The key string.
toSpaceSeparated
Method to convert a string into space separated form.
toSpaceSeparated(string $input) : string
since |
1.0 |
---|
Arguments
- $input
string
The string input (ASCII only).
Response
string
The space separated string.
toUnderscoreSeparated
Method to convert a string into underscore separated form.
toUnderscoreSeparated(string $input) : string
since |
1.0 |
---|
Arguments
- $input
string
The string input (ASCII only).
Response
string
The underscore separated string.
toVariable
Method to convert a string into variable form.
toVariable(string $input) : string
since |
1.0 |
---|
Arguments
- $input
string
The string input (ASCII only).
Response
string
The variable string.