没有命名空间的类 yii yii\base yii\behaviors yii\caching yii\captcha yii\console yii\console\controllers yii\console\widgets yii\data yii\db yii\db\conditions yii\db\cubrid yii\db\cubrid\conditions yii\db\mssql yii\db\mssql\conditions yii\db\mysql yii\db\oci yii\db\oci\conditions yii\db\pgsql yii\db\sqlite yii\db\sqlite\conditions yii\di yii\filters yii\filters\auth yii\grid yii\helpers yii\i18n yii\log yii\mail yii\mutex yii\rbac yii\rest yii\test yii\validators yii\web yii\widgets

Class yii\helpers\Inflector

继承yii\helpers\Inflector » yii\helpers\BaseInflector
可用版本自2.0
源码 https://github.com/yiichina/yii2/blob/api/framework/helpers/Inflector.php

Inflector pluralizes and singularizes English nouns. It also contains some other useful methods.

公共属性

隐藏继承的属性

属性类型描述被定义在
$plurals array The rules for converting a word into its plural form. yii\helpers\BaseInflector
$singulars array The rules for converting a word into its singular form. yii\helpers\BaseInflector
$specials array The special rules for converting a word between its plural form and singular form. yii\helpers\BaseInflector
$transliteration array Fallback map for transliteration used by transliterate() when intl isn't available. yii\helpers\BaseInflector
$transliterator mixed Either a \Transliterator, or a string from which a \Transliterator can be built for transliteration. yii\helpers\BaseInflector

公共方法

隐藏继承的方法

方法描述被定义在
camel2id() Converts a CamelCase name into an ID in lowercase. yii\helpers\BaseInflector
camel2words() Converts a CamelCase name into space-separated words. yii\helpers\BaseInflector
camelize() Returns given word as CamelCased. yii\helpers\BaseInflector
classify() Converts a table name to its class name. yii\helpers\BaseInflector
humanize() Returns a human-readable string from $word. yii\helpers\BaseInflector
id2camel() Converts an ID into a CamelCase name. yii\helpers\BaseInflector
ordinalize() Converts number to its ordinal English form. For example, converts 13 to 13th, 2 to 2nd . yii\helpers\BaseInflector
pluralize() Converts a word to its plural form. yii\helpers\BaseInflector
sentence() Converts a list of words into a sentence. yii\helpers\BaseInflector
singularize() Returns the singular of the $word. yii\helpers\BaseInflector
slug() Returns a string with all spaces converted to given replacement, non word characters removed and the rest of characters transliterated. yii\helpers\BaseInflector
tableize() Converts a class name to its table name (pluralized) naming conventions. yii\helpers\BaseInflector
titleize() Converts an underscored or CamelCase word into a English sentence. yii\helpers\BaseInflector
transliterate() Returns transliterated version of a string. yii\helpers\BaseInflector
underscore() Converts any "CamelCased" into an "underscored_word". yii\helpers\BaseInflector
variablize() Same as camelize but first char is in lowercase. yii\helpers\BaseInflector

受保护的方法

隐藏继承的方法

方法描述被定义在
hasIntl() yii\helpers\BaseInflector

常量

隐藏继承的常量

常量描述被定义在
TRANSLITERATE_LOOSE 'Any-Latin; Latin-ASCII; [\u0080-\uffff] remove' Shortcut for Any-Latin; Latin-ASCII; [\u0080-\uffff] remove transliteration rule. The rule is loose, letters will be transliterated with the characters of Basic Latin Unicode Block. For example: 获取到 どちら Українська: ґ,є, Српска: ђ, њ, џ! ¿Español? will be transliterated to huo qu dao dochira Ukrainska: g,e, Srpska: d, n, d! Espanol?. Used in transliterate(). For detailed information see unicode normalization forms yii\helpers\BaseInflector
TRANSLITERATE_MEDIUM 'Any-Latin; Latin-ASCII' Shortcut for Any-Latin; Latin-ASCII transliteration rule. The rule is medium, letters will be transliterated to characters of Latin-1 (ISO 8859-1) ASCII table. For example: 获取到 どちら Українська: ґ,є, Српска: ђ, њ, џ! ¿Español? will be transliterated to huo qu dao dochira Ukrainsʹka: g,e, Srpska: d, n, d! ¿Espanol?. Used in transliterate(). For detailed information see unicode normalization forms yii\helpers\BaseInflector
TRANSLITERATE_STRICT 'Any-Latin; NFKD' Shortcut for Any-Latin; NFKD transliteration rule. The rule is strict, letters will be transliterated with the closest sound-representation chars. The result may contain any UTF-8 chars. For example: 获取到 どちら Українська: ґ,є, Српска: ђ, њ, џ! ¿Español? will be transliterated to huò qǔ dào dochira Ukraí̈nsʹka: g̀,ê, Srpska: đ, n̂, d̂! ¿Español?. Used in transliterate(). For detailed information see unicode normalization forms yii\helpers\BaseInflector