|
47 | 47 |
|
48 | 48 | <h2>Inflector Class</h2> |
49 | 49 |
|
50 | | - <p>The Inflector class allows you to transforms words from singular to plural, class names to table names, modularized class names to ones without, and class names to foreign keys.</p> |
| 50 | + <p> |
| 51 | + The Inflector class allows you to transforms words from singular to plural, |
| 52 | + class names to table names, modularized class names to ones without, |
| 53 | + and class names to foreign keys. |
| 54 | + </p> |
| 55 | + <p> |
| 56 | + Inflector rulesets can be defined as language files, to be able to localize them. |
| 57 | + The framework comes with a default set of rules for the English language, which |
| 58 | + can act as a template for localisation. |
| 59 | + </p> |
| 60 | + |
51 | 61 |
|
52 | 62 | <article> |
53 | 63 | <h4 class="method" id="method_ascii">ascii($str, $allow_non_ascii = false)</h4> |
@@ -735,6 +745,41 @@ <h4 class="method" id="method_underscore">underscore($camel_cased_word)</h4> |
735 | 745 | </table> |
736 | 746 | </article> |
737 | 747 |
|
| 748 | + <article> |
| 749 | + <h4 class="method" id="method_load_rules">load_rules()</h4> |
| 750 | + <p> |
| 751 | + The <strong>load_rules</strong> method loads the inflector rules based on the current |
| 752 | + language configuration. If no rulesset can be found (i.e. no inflector lang file exists), |
| 753 | + the class will default to a ruleset for the English language. If you have loaded a ruleset, |
| 754 | + you change your language configuration, reload again, but the new configuration doesn't have |
| 755 | + a ruleset defined, Inflector will continue to use the current one. |
| 756 | + </p> |
| 757 | + <p class="note"> |
| 758 | + Upon first use the Inflector class will autoload the the ruleset based on the language |
| 759 | + configuration. Normally you do not have to use this method. |
| 760 | + </p> |
| 761 | + <table class="method"> |
| 762 | + <tbody> |
| 763 | + <tr> |
| 764 | + <th class="legend">Static</th> |
| 765 | + <td>Yes</td> |
| 766 | + </tr> |
| 767 | + <tr> |
| 768 | + <th>Parameters</th> |
| 769 | + <td> |
| 770 | + None |
| 771 | + </td> |
| 772 | + </tr> |
| 773 | + <tr> |
| 774 | + <th>Example</th> |
| 775 | + <td> |
| 776 | + <pre class="php"><code>Inflector::load_rules(); // (re)loads the Inflector ruleset</code></pre> |
| 777 | + </td> |
| 778 | + </tr> |
| 779 | + </tbody> |
| 780 | + </table> |
| 781 | + </article> |
| 782 | + |
738 | 783 | </div> |
739 | 784 |
|
740 | 785 | <footer> |
|
0 commit comments