X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=blobdiff_plain;f=user_guide%2Fhelpers%2Finflector_helper.html;fp=user_guide%2Fhelpers%2Finflector_helper.html;h=221c05907b40544b45d56c8c037f7ba5fcf2de2d;hb=6d8f5b56b237767344bc4a283b4093e6d6f1a612;hp=0000000000000000000000000000000000000000;hpb=0f67329ebdddeb59a2b6b79aedb1fce421378ca8;p=living-lab-site.git diff --git a/user_guide/helpers/inflector_helper.html b/user_guide/helpers/inflector_helper.html new file mode 100755 index 0000000..221c059 --- /dev/null +++ b/user_guide/helpers/inflector_helper.html @@ -0,0 +1,151 @@ + + + + + +Inflector Helper : CodeIgniter User Guide + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +

CodeIgniter User Guide Version 2.0.2

+
+ + + + + + + + + +
+ + +
+ + + +
+ + +

Inflector Helper

+ +

The Inflector Helper file contains functions that permits you to change words to plural, singular, camel case, etc.

+ + +

Loading this Helper

+ +

This helper is loaded using the following code:

+$this->load->helper('inflector'); + +

The following functions are available:

+ + +

singular()

+ +

Changes a plural word to singular. Example:

+ + +$word = "dogs";
+echo singular($word); // Returns "dog" +
+ + +

plural()

+ +

Changes a singular word to plural. Example:

+ + +$word = "dog";
+echo plural($word); // Returns "dogs" +
+ + +

To force a word to end with "es" use a second "true" argument.

+ $word = "pass";
+echo plural($word, TRUE); // Returns "passes"
+ +

camelize()

+

Changes a string of words separated by spaces or underscores to camel case. Example:

+ + +$word = "my_dog_spot";
+echo camelize($word); // Returns "myDogSpot" +
+ + +

underscore()

+ +

Takes multiple words separated by spaces and underscores them. Example:

+ + +$word = "my dog spot";
+echo underscore($word); // Returns "my_dog_spot" +
+ + +

humanize()

+ +

Takes multiple words separated by underscores and adds spaces between them. Each word is capitalized. Example:

+ + +$word = "my_dog_spot";
+echo humanize($word); // Returns "My Dog Spot" +
+ + + + + + + + + + + + +
+ + + + + + + \ No newline at end of file