◆ buildRuleset()
static buildRuleset |
( |
iterable |
$rules | ) |
|
|
staticprivate |
- Paramètres
-
array<string,mixed>|iterable<string,mixed> | $rules An array of rules to be added. |
◆ camelize()
static camelize |
( |
string |
$word | ) |
|
|
static |
Camelizes a word. This uses the classify() method and turns the first character to lowercase.
- Obsolète:
◆ classify()
static classify |
( |
string |
$word | ) |
|
|
static |
Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'.
◆ createFactory()
◆ getInstance()
◆ pluralize()
static pluralize |
( |
string |
$word | ) |
|
|
static |
◆ reset()
Clears Inflectors inflected value caches, and resets the inflection rules to the initial values.
- Obsolète:
Références null.
◆ rules()
static rules |
( |
string |
$type, |
|
|
iterable |
$rules, |
|
|
bool |
$reset = false |
|
) |
| |
|
static |
Adds custom inflection $rules, of either 'plural' or 'singular' $type.
Usage:
{{{ Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); Inflector::rules('plural', array( 'rules' => array('/^(inflect)ors$/i' => '\1ables'), 'uninflected' => array('dontinflectme'), 'irregular' => array('red' => 'redlings') )); }}}
- Paramètres
-
string | $type | The type of inflection, either 'plural' or 'singular' |
| array<string,mixed>|iterable<string,mixed> | $rules An array of rules to be added. |
boolean | $reset | If true, will unset default inflections for all new rules that are being defined in $rules. |
- Renvoie
- void
- Obsolète:
Références $type, et null.
◆ singularize()
static singularize |
( |
string |
$word | ) |
|
|
static |
◆ tableize()
static tableize |
( |
string |
$word | ) |
|
|
static |
Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'.
- Obsolète:
◆ ucwords()
static ucwords |
( |
string |
$string, |
|
|
string |
$delimiters = " \n\t\r\0\x0B-" |
|
) |
| |
|
static |
Uppercases words with configurable delimiters between words.
Takes a string and capitalizes all of the words, like PHP's built-in ucwords function. This extends that behavior, however, by allowing the word delimiters to be configured, rather than only separating on whitespace.
Here is an example: <?php $string = 'top-o-the-morning to all_of_you!'; echo ::ucwords($string); // Top-O-The-Morning To All_of_you!
echo ::ucwords($string, '-_ '); // Top-O-The-Morning To All_Of_You! ?>
- Paramètres
-
string | $string | The string to operate on. |
string | $delimiters | A list of word separators. |
- Renvoie
- string The string with all delimiter-separated words capitalized.
- Obsolète:
◆ $factory
◆ $instance
La documentation de cette classe a été générée à partir du fichier suivant :