@@ -45,7 +45,7 @@ Both `pluralize` and `singularize()` work on most English nouns. If you need
4545to support other languages, you can use [ Inflection Configuration] ( #inflection-configuration ) to
4646customize the rules used:
4747
48- ``` text
48+ ``` php
4949// Apples
5050echo Inflector::pluralize('Apple');
5151```
@@ -65,7 +65,7 @@ echo Inflector::singularize('People');
6565
6666These methods are useful when creating class names, or property names:
6767
68- ``` text
68+ ``` php
6969// ApplePie
7070Inflector::camelize('Apple_pie')
7171
@@ -82,7 +82,7 @@ underscore.
8282This method is useful when converting underscored forms into "Title Case" forms
8383for human readable values:
8484
85- ``` text
85+ ``` php
8686// Apple Pie
8787Inflector::humanize('apple_pie');
8888```
@@ -92,7 +92,7 @@ Inflector::humanize('apple_pie');
9292When generating code, or using CakePHP's conventions you may need to inflect
9393table names or class names:
9494
95- ``` text
95+ ``` php
9696// UserProfileSetting
9797Inflector::classify('user_profile_settings');
9898
@@ -108,7 +108,7 @@ Inflector::tableize('UserProfileSetting');
108108Variable names are often useful when doing meta-programming tasks that involve
109109generating code or doing work based on conventions:
110110
111- ``` text
111+ ``` php
112112// applePie
113113Inflector::variable('apple_pie');
114114```
@@ -118,7 +118,7 @@ Inflector::variable('apple_pie');
118118Slug converts special characters into latin versions and converting unmatched
119119characters and spaces to dashes. The slug method expects UTF-8 encoding:
120120
121- ``` text
121+ ``` php
122122// apple-puree
123123Inflector::slug('apple purée');
124124```
@@ -148,7 +148,7 @@ special cases.
148148Define new inflection and transliteration rules for Inflector to use. Often,
149149this method is used in your ** config/bootstrap.php** :
150150
151- ``` css
151+ ``` php
152152Inflector::rules('singular', ['/^(bil)er$/i' => '\1', '/^(inflec|contribu)tors$/i' => '\1ta']);
153153Inflector::rules('uninflected', ['singulars']);
154154Inflector::rules('irregular', ['phylum' => 'phyla']); // The key is singular form, value is plural form
0 commit comments