Overview

Applies inflections to words: singular, plural, camel, underscore, etc.

Package

This class is part of the Solar_Inflect package.

Inheritance:

Configuration Keys

  • identical: Words that do not change from singular to plural.

  • irregular: Irregular singular-to-plural inflections.

  • to_singular: Rules for preg_replace() to convert plurals to singulars.

  • to_plural: Rules for preg_replace() to convert singulars to plurals.

Constants

None.

Public Properties

The Solar_Inflect class has no public properties; try the list of all properties.

Public Methods

These are all the public methods in the Solar_Inflect class.

You can also view the list of all public, protected, and private methods.

__construct()

Constructor.

__destruct()

Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().

camelToDashes()

Returns "camelCapsWord" and "CamelCapsWord" as "camel-caps-word".

camelToUnder()

Returns "camelCapsWord" and "CamelCapsWord" as "Camel_Caps_Word".

classToFile()

Returns "Class_Name" as "Class/Name.php".

dashesToCamel()

Returns "foo-bar-baz" as "fooBarBaz".

dashesToStudly()

Returns "foo-bar-baz" as "FooBarBaz".

dump()

Convenience method for getting a dump the whole object, or one of its properties, or an external variable.

locale()

Looks up class-specific locale strings based on a key.

toDashes()

Returns any string, converted to using dashes with only lowercase alphanumerics.

toPlural()

Returns a singular word as a plural.

toSingular()

Returns a plural word as a singular.

underToCamel()

Returns "foo_bar_baz" as "fooBarBaz".

underToStudly()

Returns "foo_bar_baz" as "FooBarBaz".



Local