Class: atkMetaGrammar
Source Location: /meta/grammar/class.atkmetagrammar.inc
Class atkMetaGrammar
Class Overview
|
The basic (english) "grammar" rules.
The singularize and pluralize methods are inspired by the methods with the same name in the Inflector module of the Ruby on Rails framework (Copyright � 2004 David Heinemeier Hansson). The Ruby on Rails framework can be found at http://www.rubyonrails.com
Located in /meta/grammar/class.atkmetagrammar.inc [line 31]
Wiki documentation
Author(s):
Information Tags:
|
Properties
|
Methods
|
Method Summary
| static
atkMetaGrammar
|
get() |
Returns an instance of the meta grammar with the given class. If no class is specified the default meta grammar is used determined using the $config_meta_grammar variable. |
| pluralized |
pluralize() |
Pluralize the given word using the plural rules. |
| singularized |
singularize() |
Singularize the given word using the singular rules. |
| transformed |
transform() |
Transform the given word using the given rules. As soon as a rule matches the given word, the word, transformed using the replacement, is returned. |
Methods
Returns an instance of the meta grammar with the given class. If no class is specified the default meta grammar is used determined using the $config_meta_grammar variable.
Parameters:
|
string |
$class: |
full ATK grammar class path |
API Tags:
| Return: | meta grammar |
| Access: | public |
Returns the list of plural rules.
API Tags:
| Return: | of plural rules |
| Access: | public |
Redefined in descendants as:
Returns the list of singular rules.
API Tags:
| Return: | of singular rules |
| Access: | public |
Redefined in descendants as:
pluralized pluralize(
string
$word
)
|
|
Pluralize the given word using the plural rules.
Parameters:
|
string |
$word: |
word to be pluralized |
API Tags:
| Return: | word |
| Access: | public |
singularized singularize(
string
$word
)
|
|
Singularize the given word using the singular rules.
Parameters:
|
string |
$word: |
word to be singularized |
API Tags:
| Return: | word |
| Access: | public |
transformed transform(
string
$word, array
$rules
)
|
|
Transform the given word using the given rules. As soon as a rule matches the given word, the word, transformed using the replacement, is returned.
Parameters:
|
string |
$word: |
word to be transformed |
|
array |
$rules: |
list of rules |
API Tags:
| Return: | word |
| Access: | public |