StringNormalise
class StringNormalise (View source)
Windwalker Framework String Normalise Class
This class is based on Joomla String package
Methods
Method to convert a string from camel case.
Method to convert a string into camel case.
Method to convert a string into dash separated form.
Method to convert a string into space separated form.
Method to convert a string into dot separated form.
Separate a string by custom separator.
Method to convert a string into underscore separated form.
Method to convert a string into variable form.
Method to convert a string into key form.
Convert to standard PSR-0/PSR-4 class name.
Details
at line line 42
static string
fromCamelCase(string $input, boolean $grouped = false)
Method to convert a string from camel case.
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") "abcdefGhiJkl" becomes array("abcdef", "GhiJkl") "ThisIsANASAAstronaut" becomes array("This", "Is", "ANASA", "Astronaut")) "JohnFitzgeraldKennedy" becomes array("John", "FitzgeraldKennedy"))
Non-grouped will split strings at each uppercase character.
at line line 58
static string
toCamelCase(string $input)
Method to convert a string into camel case.
at line line 77
static string
toDashSeparated(string $input)
Method to convert a string into dash separated form.
at line line 92
static string
toSpaceSeparated(string $input)
Method to convert a string into space separated form.
at line line 107
static string
toDotSeparated(string $input)
Method to convert a string into dot separated form.
at line line 123
static string
separate(string $input, string $separator = '_')
Separate a string by custom separator.
at line line 137
static string
toUnderscoreSeparated(string $input)
Method to convert a string into underscore separated form.
at line line 152
static string
toVariable(string $input)
Method to convert a string into variable form.
at line line 180
static string
toKey(string $input)
Method to convert a string into key form.
at line line 198
static string
toClassNamespace(string $class)
Convert to standard PSR-0/PSR-4 class name.