Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe FOFInflector

Fonctions membres publiques statiques

static deleteCache ()
 
static addWord ($singular, $plural)
 
static pluralize ($word)
 
static singularize ($word)
 
static camelize ($word)
 
static underscore ($word)
 
static explode ($word)
 
static implode ($words)
 
static humanize ($word)
 
static tableize ($className)
 
static classify ($tableName)
 
static variablize ($string)
 
static isSingular ($string)
 
static isPlural ($string)
 
static getPart ($string, $index, $default=null)
 

Attributs protégés statiques

static $_rules
 
static $_cache
 

Fonctions membres privées

 __construct ()
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( )
private

Constructor

Prevent creating instances of this class by making the constructor private

Documentation des fonctions membres

◆ addWord()

static addWord (   $singular,
  $plural 
)
static

Add a word to the cache, useful to make exceptions or to add words in other languages.

Paramètres
string$singularword.
string$pluralword.
Renvoie
void

◆ camelize()

static camelize (   $word)
static

Returns given word as CamelCased.

Converts a word like "foo_bar" or "foo bar" to "FooBar". It will remove non alphanumeric characters from the word, so "who's online" will be converted to "WhoSOnline"

Paramètres
string$wordWord to convert to camel case.
Renvoie
string UpperCamelCasedWord

Référencé par FOFAutoloaderComponent\autoload_fof_controller(), FOFAutoloaderComponent\autoload_fof_helper(), FOFAutoloaderComponent\autoload_fof_model(), FOFAutoloaderComponent\autoload_fof_table(), FOFAutoloaderComponent\autoload_fof_view(), FOFController\execute(), et FOFView\findRenderer().

◆ classify()

static classify (   $tableName)
static

◆ deleteCache()

static deleteCache ( )
static

◆ explode()

static explode (   $word)
static

Convert any "CamelCased" word into an array of strings

Returns an array of strings each of which is a substring of string formed by splitting it at the camelcased letters.

Paramètres
string$wordWord to explode
Renvoie
array Array of strings

Référencé par FOFDatabaseIterator\__construct(), FOFController\__construct(), FOFTableRelations\getIteratorFromRelation(), FOFFormHeaderModel\getOptions(), FOFFormFieldModel\getOptions(), FOFTableRelations\getTableFromRelation(), FOFController\getThisModel(), FOFController\getThisView(), et FOFTableRelations\normaliseParameters().

◆ getPart()

static getPart (   $string,
  $index,
  $default = null 
)
static

Gets a part of a CamelCased word by index.

Use a negative index to start at the last part of the word (-1 is the last part)

Paramètres
string$stringWord
integer$indexIndex of the part
string$defaultDefault value
Renvoie
string

Références $default, et $parts.

Référencé par FOFView\findRenderer().

◆ humanize()

static humanize (   $word)
static

Returns a human-readable string from $word.

Returns a human-readable string from $word, by replacing underscores with a space, and by upper-casing the initial character by default.

Paramètres
string$wordString to "humanize"
Renvoie
string Human-readable word

◆ implode()

static implode (   $words)
static

Convert an array of strings into a "CamelCased" word.

Paramètres
array$wordsArray to implode
Renvoie
string UpperCamelCasedWord

Référencé par FOFFormHeaderModel\getOptions(), FOFFormFieldModel\getOptions(), FOFController\getThisModel(), FOFController\getThisView(), et FOFTableRelations\normaliseItemName().

◆ isPlural()

static isPlural (   $string)
static

Check to see if an Enlish word is plural.

Paramètres
string$stringString to be checked.
Renvoie
boolean

Références null.

Référencé par FOFController\createView(), FOFDispatcher\getTask(), et FOFToolbar\renderSubmenu().

◆ isSingular()

◆ pluralize()

◆ singularize()

static singularize (   $word)
static

Plural English word to singular.

Paramètres
string$wordWord to singularize.
Renvoie
string Singular noun.

Références null.

Référencé par FOFTableRelations\__construct(), FOFView\__construct(), FOFController\__construct(), FOFTable\__construct(), FOFModel\__construct(), FOFAutoloaderComponent\autoload_fof_controller(), FOFAutoloaderComponent\autoload_fof_helper(), FOFAutoloaderComponent\autoload_fof_model(), FOFAutoloaderComponent\autoload_fof_table(), FOFAutoloaderComponent\autoload_fof_view(), FOFController\checkACL(), FOFController\createView(), FOFDispatcher\dispatch(), FOFModel\findFormFilename(), FOFTable\getAnInstance(), FOFModel\getIterator(), FOFTableRelations\getSiblings(), FOFModel\getTable(), FOFController\getTmpInstance(), FOFIntegrationJoomlaPlatform\getViewTemplatePaths(), FOFController\loadhistory(), FOFTableRelations\normaliseItemName(), FOFTableRelations\normaliseParameters(), FOFController\onBeforeAccesspublic(), FOFController\onBeforeAccessregistered(), FOFController\onBeforeAccessspecial(), FOFController\onBeforeAdd(), FOFController\onBeforeApply(), FOFController\onBeforeBrowse(), FOFController\onBeforeCancel(), FOFController\onBeforeEdit(), FOFController\onBeforeGenericTask(), FOFController\onBeforeOrderdown(), FOFController\onBeforeOrderup(), FOFController\onBeforePublish(), FOFController\onBeforeRemove(), FOFController\onBeforeSave(), FOFController\onBeforeSavenew(), FOFController\onBeforeSaveorder(), FOFController\onBeforeUnpublish(), et FOFToolbar\renderSubmenu().

◆ tableize()

static tableize (   $className)
static

Converts a class name to its table name according to Koowa naming conventions.

Converts "Person" to "people"

Paramètres
string$classNameClass name for getting related table_name.
Renvoie
string plural_table_name
Voir également
classify

Références $className.

◆ underscore()

static underscore (   $word)
static

Converts a word "into_it_s_underscored_version"

Convert any "CamelCased" or "ordinary Word" into an "underscored_word".

Paramètres
string$wordWord to underscore
Renvoie
string Underscored word

◆ variablize()

static variablize (   $string)
static

Returns camelBacked version of a string. Same as camelize but first char is lowercased.

Paramètres
string$stringString to be camelBacked.
Renvoie
string
Voir également
camelize

Documentation des champs

◆ $_cache

$_cache
staticprotected
Valeur initiale :
= array(
'singularized' => array(),
'pluralized' => array()
)

◆ $_rules

$_rules
staticprotected

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