Download the PHP package talesoft/tale-inflector without Composer
On this page you can find all versions of the php package talesoft/tale-inflector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download talesoft/tale-inflector
More information about talesoft/tale-inflector
Files in talesoft/tale-inflector
Package tale-inflector
Short Description A library that can inflect strings to many formats
License MIT
Homepage http://docs.talesoft.codes/php/tale/inflector
Informations about the package tale-inflector
Tale Inflector
What is Tale Inflector?
Tale inflector bends strings into different naming styles. A common use-case would be the converting of class-names or property-names to table-names or titles to slugs for URLs.
It can also generate the plural or singular of a string or ordinalize numbers.
Installation
Usage
Available strategies/static methods
camelize
Tale\Inflector\Strategy\CamelCaseStrategy
some Random string = SomeRandomString
dasherize
Tale\Inflector\Strategy\DashRejoinStrategy
some Random string = some-Random-string
canonicalize
Tale\Inflector\Strategy\KebabCaseStrategy
some Random string = some-random-string
variableize
Tale\Inflector\Strategy\LowerCamelCaseStrategy
some Random string = someRandomString
constantize
Tale\Inflector\Strategy\MacroCaseStrategy
some Random string = SOME_RANDOM_STRING
tableize
Tale\Inflector\Strategy\SnakeCaseStrategy
some Random string = some_random_string
underscorize
Tale\Inflector\Strategy\UnderscoreRejoinStrategy
some Random string = some_Random_string
humanize
Tale\Inflector\Strategy\UppercaseWordsStrategy
some Random string = Some Random String
ordinalize
Tale\Inflector\Strategy\NumberOrdinalStrategy
1 = 1st
12 = 12th
23 = 23rd
pluralize
Tale\Inflector\Strategy\MacroCaseStrategy
rabbit = rabbits
car = cars
house = houses
singularize
Tale\Inflector\Strategy\MacroCaseStrategy
rabbits = rabbit
cars = car
houses = house
Roll your own
You can register your own short names