| 1 | <?php |
||
| 12 | class Strings |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * |
||
| 16 | * @param string $input |
||
| 17 | * @param string $separator |
||
| 18 | * @return string |
||
| 19 | */ |
||
| 20 | 1 | public static function decamelize($input, $separator = '-') |
|
| 24 | |||
| 25 | /** |
||
| 26 | * Will return CamelCased value from `input`. |
||
| 27 | * |
||
| 28 | * Example: |
||
| 29 | * |
||
| 30 | * ``` |
||
| 31 | * camelize('my-html-id'); |
||
| 32 | * ``` |
||
| 33 | * |
||
| 34 | * Will return `MyHtmlId`. |
||
| 35 | * |
||
| 36 | * Can also accept different separator or make first letter lower case: |
||
| 37 | * |
||
| 38 | * ``` |
||
| 39 | * camelize('\My\Php\ClassName', '\\', true); |
||
| 40 | * ``` |
||
| 41 | * |
||
| 42 | * Will return `myPhpClassName`. This might be useful for generating HTML id's |
||
| 43 | * from PHP class names. |
||
| 44 | * |
||
| 45 | * @param string $input |
||
| 46 | * @param string $separator |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | public static function camelize($input, $separator = '-', $lcFirst = false) |
||
| 60 | } |