Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe Inflector
+ Graphe d'héritage de Inflector:

Fonctions membres publiques statiques

static tableize (string $word)
 
static classify (string $word)
 
static camelize (string $word)
 
static ucwords (string $string, string $delimiters=" \\\B-")
 
static reset ()
 
static rules (string $type, iterable $rules, bool $reset=false)
 
static pluralize (string $word)
 
static singularize (string $word)
 

Fonctions membres privées statiques

static getInstance ()
 
static createFactory ()
 
static buildRuleset (iterable $rules)
 

Attributs privés statiques

static $factory
 
static $instance
 

Description détaillée

Documentation des fonctions membres

◆ 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()

static createFactory ( )
staticprivate

◆ getInstance()

static getInstance ( )
staticprivate

Références null.

Référencé par FormController\__construct(), et ListView\addToolbar().

◆ pluralize()

static pluralize ( string  $word)
static

Returns a word in plural form.

Paramètres
string$wordThe word in singular form.
Renvoie
string The word in plural form.
Obsolète:

Référencé par DisplayController\display().

◆ reset()

static reset ( )
static

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$typeThe type of inflection, either 'plural' or 'singular'
array<string,mixed>|iterable<string,mixed>$rules An array of rules to be added.
boolean$resetIf 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

Returns a word in singular form.

Paramètres
string$wordThe word in plural form.
Renvoie
string The word in singular form.
Obsolète:

Référencé par MediaController\delete(), et StylesController\preprocessSaveData().

◆ 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$stringThe string to operate on.
string$delimitersA list of word separators.
Renvoie
string The string with all delimiter-separated words capitalized.
Obsolète:

Documentation des champs

◆ $factory

$factory
staticprivate

◆ $instance

$instance
staticprivate

La documentation de cette classe a été générée à partir du fichier suivant :