Download the PHP package icanboogie/inflector without Composer
On this page you can find all versions of the php package icanboogie/inflector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download icanboogie/inflector
More information about icanboogie/inflector
Files in icanboogie/inflector
Package inflector
Short Description Multilingual inflector that transforms words from singular to plural, underscore to camel case, and more.
License BSD-3-Clause
Homepage https://icanboogie.org/
Informations about the package inflector
Inflector
A multilingual inflector that transforms words from singular to plural, underscore to camel case, and formats strings in various ways. Inflections are localized, the default english inflections for pluralization, singularization, and uncountable words are kept in lib/Inflections/en.php.
Inflections are currently available for the following languages:
- English (
en
) - French (
fr
) - Norwegian Bokmal (
nb
) - Portuguese (
pt
) - Spanish (
es
) - Turkish (
tr
)
Installation
Usage
These are some examples of the inflector with the en
locale (default).
Helpers makes it easy to use default locale inflections.
About inflections
Inflections are localized, the configurators are kept in lib/Inflections/en.php. Since v2.1,
these configurators are auto-loaded classes, which means, in theory, you could add your own or overwrite those already
defined by specifying another ICanBoogie\\Inflections\\
in your composer.json
file.
Acknowledgements
Most of the code and documentation was adapted from Ruby On Rails's Inflector and David Celis' inflections.
Significant differences:
- Better support of accentuated characters.
- The Ruby module separator
::
as been replaced by the PHP namespace separator\
. - The plural of "octopus" is "octopuses" (not "octopi"), the plural of "virus" is "viruses" (not viri) and the pural of "cow" is "cows" (not "kine").
- The following methods have been removed:
tableize
,classify
,demodulize
,constantize
,deconstantize
andforeign_key
. They can be easily implemented in specific inflectors. - Added the
hyphenate
method, which is a combination ofunderscore
anddasherize
. - One specifies
true
rather thanfalse
tocamelize()
to downcase the first letter of the camel cased string.
Getting started
Inflector expects to work in UTF-8, which is the default encoding character set starting
PHP 5.6, for older versions please use mb_internal_encoding()
as follows:
Continuous Integration
The project is continuously tested by GitHub actions.
Code of Conduct
This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you are expected to uphold this code.
Contributing
Please see CONTRIBUTING for details.
License
icanboogie/inflector is released under the BSD-3-Clause.
All versions of inflector with dependencies
ext-mbstring Version *