Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe Inflector

Fonctions membres publiques

 __construct (WordInflector $singularizer, WordInflector $pluralizer)
 
 tableize (string $word)
 
 classify (string $word)
 
 camelize (string $word)
 
 capitalize (string $string, string $delimiters=" \\\B-")
 
 seemsUtf8 (string $string)
 
 unaccent (string $string)
 
 urlize (string $string)
 
 singularize (string $word)
 
 pluralize (string $word)
 

Attributs privés

const ACCENTED_CHARACTERS
 
 $singularizer
 
 $pluralizer
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( WordInflector  $singularizer,
WordInflector  $pluralizer 
)

Documentation des fonctions membres

◆ camelize()

camelize ( string  $word)

Camelizes a word. This uses the classify() method and turns the first character to lowercase.

Références Inflector\classify().

◆ capitalize()

capitalize ( string  $string,
string  $delimiters = " \n\t\r\0\x0B-" 
)

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 $inflector->capitalize($string); // Top-O-The-Morning To All_of_you!

echo $inflector->capitalize($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.

◆ classify()

classify ( string  $word)

Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'.

Référencé par Inflector\camelize().

◆ pluralize()

pluralize ( string  $word)

Returns a word in plural form.

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

◆ seemsUtf8()

seemsUtf8 ( string  $string)

Checks if the given string seems like it has utf8 characters in it.

Paramètres
string$stringThe string to check for utf8 characters in.

Références $i, $n, et elseif.

Référencé par Inflector\unaccent().

◆ singularize()

singularize ( string  $word)

Returns a word in singular form.

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

◆ tableize()

tableize ( string  $word)

Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'.

Références null.

◆ unaccent()

unaccent ( string  $string)

Remove any illegal characters, accents, etc.

Paramètres
string$stringString to unaccent
Renvoie
string Unaccented string

Références Inflector\seemsUtf8().

Référencé par Inflector\urlize().

◆ urlize()

urlize ( string  $string)

Convert any passed string to a url friendly string. Converts 'My first blog post' to 'my-first-blog-post'

Paramètres
string$stringString to urlize.
Renvoie
string Urlized string.

Références null, et Inflector\unaccent().

Documentation des champs

◆ $pluralizer

$pluralizer
private

Référencé par Inflector\__construct().

◆ $singularizer

$singularizer
private

Référencé par Inflector\__construct().

◆ ACCENTED_CHARACTERS

const ACCENTED_CHARACTERS
private
Valeur initiale :
= [
'À' => 'A'

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