2017 © Pedro Peláez
 

library camelize

Utility for camel and uncamel casing words or phrases.

image

salernolabs/camelize

Utility for camel and uncamel casing words or phrases.

  • Friday, April 28, 2017
  • by ericsalerno
  • Repository
  • 1 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 57 % Grown

The README.md

salernolabs/camelize

Latest Stable Version License Build Status, (*1)

Simple library to perform camel and uncamel casing of words or phrases. The library is designed to by multibyte character safe. PHPUnit tests are included., (*2)

Not sure just how useful this is as a library but I've used it for some code modification processes in the past., (*3)

Usage

First include the library with composer., (*4)

composer require salernolabs/camelize

Camel Casing

The camel casing utility assumes your input string is hungarian notation, or something similar. To camel case something, try this:, (*5)

$camelizer = new \SalernoLabs\Camelize\Camel();

$output = $camelizer->camelize('some_text_in_some_notation');

echo $output;

This should output "SomeTextInSomeNotation". You can also do:, (*6)

//Defaults to true
$camelizer->setShouldCapitalizeFirstCharacter(false);

And the resulting output would be "someTextInSomeNotation"., (*7)

### Uncamel Casing, (*8)

The uncamel casing utility assumes your input string is already in Camel Case notation. To uncamelize something, try this:, (*9)

$uncamelizer = new \SalernoLabs\Camelize\Uncamel();

$output = $uncamelizer->uncamelize('SomeTextInCamelCase');

echo $output;

This should output "some_text_in_camel_case" (snake case). You can also do:, (*10)

//Defaults to false
$uncamelizer->setShouldCapitalizeFirstCharacter(true);

And the resulting output would be "Some_Text_In_Camel_Case"., (*11)

The Versions

28/04 2017

dev-master

9999999-dev http://www.salernolabs.com/

Utility for camel and uncamel casing words or phrases.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

php camel case

28/04 2017

0.1.3

0.1.3.0 http://www.salernolabs.com/

Utility for camel and uncamel casing words or phrases.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

php camel case

14/04 2017

0.1.2

0.1.2.0 http://www.salernolabs.com/

Utility for camel and uncamel casing words or phrases.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

php camel case

14/04 2017

0.1.1

0.1.1.0 http://www.salernolabs.com/

Utility for camel and uncamel casing words or phrases.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

php camel case

14/04 2017

0.1.0

0.1.0.0 http://www.salernolabs.com/

Utility for camel and uncamel casing words or phrases.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

php camel case