_init()
ascii()
camelize()
classify()
demodulize()
denamespace()
foreign_key()
friendly_title()
get_namespace()
humanize()
is_countable()
load_rules()
ordinalize()
pluralize()
singularize()
tableize()
underscore()
words_to_upper()
$plural_rules
$singular_rules
$uncountable_words
Some of this code was written by Flinn Mueller.
package | Fuel |
---|---|
category | Core |
copyright | Flinn Mueller |
link | http://docs.fuelphp.com/classes/inlector.html |
_init()
ascii(string $str, bool $allow_non_ascii) : string
string
string to translate
bool
whether to remove non ascii
string
translated stringcamelize(string $underscored_word) : string
string
the underscored word
string
the CamelCased version of $underscored_wordclassify(string $name, bool $force_singular) : string
string
the table name
bool
whether to singularize the table name or not
string
the class namedemodulize(string $class_name_in_module) : string
string
the modulized class
string
the string without the class namedenamespace(string $class_name) : string
string
the class name
string
the string without the namespaceforeign_key(string $class_name, bool $use_underscore) : string
string
the class name
bool
whether to use an underscore or not
string
the foreign keyfriendly_title(string $str, string $sep, bool $lowercase, bool $allow_non_ascii) : string
Only works with UTF8 input and and only outputs 7 bit ASCII characters.
string
the text
string
the separator
bool
whether to convert to lowercase
bool
whether to allow non ascii
string
the new titleget_namespace(string $class_name) : string
string
the class name
string
the string without the namespacehumanize(string $str, string $sep, bool $lowercase) : string
string
the word
string
the separator (either _ or -)
bool
lowercase string and upper case first
string
the human version of given stringis_countable(string $word) : bool
string
the word to check
bool
if the word is countableload_rules()
ordinalize(int $number) : string
1st 2nd 3rd 4th 5th
link | http://snipplr.com/view/4627/a-function-to-add-a-prefix-to-numbers-ex-1st-2nd-3rd-4th-5th/ |
---|
int
the number to ordinalize
string
the ordinalized version of $numberpluralize(string $word, int $count) : string
string
the word to pluralize
int
number of instances
string
the plural version of $wordsingularize(string $word) : string
string
the word to singularize
string
the singular version of $wordtableize(string $class_name) : string
The table name is a pluralized version of the class name.
string
the table name
string
the table nameunderscore(string $camel_cased_word) : string
string
the CamelCased word
string
an underscore separated version of $camel_cased_wordwords_to_upper(string $class, string $sep) : string
string
classname
string
separator
string
$plural_rules : array
$singular_rules : array
$uncountable_words : array