[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/string/src/ -> Normalise.php (summary)

Part of the Joomla Framework String Package

Copyright: Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
License: GNU General Public License version 2 or later; see LICENSE
File Size: 148 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 functions

  fromCamelCase()
  toCamelCase()
  toDashSeparated()
  toSpaceSeparated()
  toUnderscoreSeparated()
  toVariable()
  toKey()

Functions
Functions that are not part of a class:

fromCamelCase($input, $grouped = false)   X-Ref
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")
"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.

param: string   $input    The string input (ASCII only).
param: boolean  $grouped  Optionally allows splitting on groups of uppercase characters.
return: array|string  The space separated string, as an array if grouped.

toCamelCase($input)   X-Ref
Method to convert a string into camel case.

param: string  $input  The string input (ASCII only).
return: string  The camel case string.

toDashSeparated($input)   X-Ref
Method to convert a string into dash separated form.

param: string  $input  The string input (ASCII only).
return: string  The dash separated string.

toSpaceSeparated($input)   X-Ref
Method to convert a string into space separated form.

param: string  $input  The string input (ASCII only).
return: string  The space separated string.

toUnderscoreSeparated($input)   X-Ref
Method to convert a string into underscore separated form.

param: string  $input  The string input (ASCII only).
return: string  The underscore separated string.

toVariable($input)   X-Ref
Method to convert a string into variable form.

param: string  $input  The string input (ASCII only).
return: string  The variable string.

toKey($input)   X-Ref
Method to convert a string into key form.

param: string  $input  The string input (ASCII only).
return: string  The key string.



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer