Skip to content

Commit dc80f51

Browse files
committed
added ordinalize() to the inflector docs. Closes #159
1 parent 90c6eb2 commit dc80f51

File tree

1 file changed

+64
-24
lines changed

1 file changed

+64
-24
lines changed

classes/inflector.html

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!doctype html>
22
<html lang="en">
33
<head>
4-
<meta charset="UTF-8">
4+
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<link rel="stylesheet" href="./../assets/css/combined.css">
77
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
@@ -20,34 +20,34 @@ <h1>
2020
<strong>FuelPHP, a PHP 5.3 Framework</strong>
2121
Documentation
2222
</h1>
23-
23+
2424
<form id="google_search">
2525
<p>
2626
<span id="search_clear">&nbsp;</span>
2727
<input type="submit" name="search_submit" id="search_submit" value="search" />
28-
<input type="text" value="" id="search_input" name="search_input" />
28+
<input type="text" value="" id="search_input" name="search_input" />
2929
</p>
3030
</form>
3131
</div>
3232
<nav>
33-
33+
3434
<div class="clear"></div>
3535
</nav>
3636
<a href="#" id="toc_handle">table of contents</a>
3737
<div class="clear"></div>
3838
</header>
39-
39+
4040
<div id="cse">
4141
<div id="cse_point"></div>
4242
<div id="cse_content"></div>
4343
</div>
44-
44+
4545
<div id="main">
46-
46+
4747
<h2>Inflector Class</h2>
48-
48+
4949
<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-
50+
5151
<article>
5252
<h4 class="method" id="method_ascii">ascii($str)</h4>
5353
<p>The <strong>ascii</strong> method allows you to translate a string to a 7-bit ASCII string. This method only works with UTF-8.</p>
@@ -87,7 +87,7 @@ <h4 class="method" id="method_ascii">ascii($str)</h4>
8787
</tbody>
8888
</table>
8989
</article>
90-
90+
9191
<article>
9292
<h4 class="method" id="method_camelize">camelize($underscored_word)</h4>
9393
<p>The <strong>camelize</strong> method allows you to convert a string with words separated by underscores into a CamelCased string.</p>
@@ -127,7 +127,7 @@ <h4 class="method" id="method_camelize">camelize($underscored_word)</h4>
127127
</tbody>
128128
</table>
129129
</article>
130-
130+
131131
<article>
132132
<h4 class="method" id="method_words_to_upper">words_to_upper($class)</h4>
133133
<p>The <strong>words_to_upper</strong> method uppercases the first letter of each word in a classname with
@@ -168,7 +168,7 @@ <h4 class="method" id="method_words_to_upper">words_to_upper($class)</h4>
168168
</tbody>
169169
</table>
170170
</article>
171-
171+
172172
<article>
173173
<h4 class="method" id="method_classify">classify($table_name)</h4>
174174
<p>The <strong>classify</strong> method allows you to convert a table name to a class name.</p>
@@ -213,7 +213,7 @@ <h4 class="method" id="method_classify">classify($table_name)</h4>
213213
</tbody>
214214
</table>
215215
</article>
216-
216+
217217
<article>
218218
<h4 class="method" id="method_demodulize">demodulize($class_name_in_module)</h4>
219219
<p>The <strong>demodulize</strong> method allows you to take the class name out of a modulized string.</p>
@@ -253,7 +253,7 @@ <h4 class="method" id="method_demodulize">demodulize($class_name_in_module)</h4>
253253
</tbody>
254254
</table>
255255
</article>
256-
256+
257257
<article>
258258
<h4 class="method" id="method_denamespace">denamespace($class_name)</h4>
259259
<p>The <strong>denamespace</strong> method allows you to take the namespace off the given class name.</p>
@@ -293,7 +293,7 @@ <h4 class="method" id="method_denamespace">denamespace($class_name)</h4>
293293
</tbody>
294294
</table>
295295
</article>
296-
296+
297297
<article>
298298
<h4 class="method" id="method_get_namespace">get_namespace($class_name)</h4>
299299
<p>The <strong>get_namespace</strong> method returns the namespace of the given class name..</p>
@@ -333,7 +333,7 @@ <h4 class="method" id="method_get_namespace">get_namespace($class_name)</h4>
333333
</tbody>
334334
</table>
335335
</article>
336-
336+
337337
<article>
338338
<h4 class="method" id="method_foreign_key">foreign_key($class_name, $use_underscore = true)</h4>
339339
<p>The <strong>foreign_key</strong> method allows you to get the foreign key for a given class.</p>
@@ -379,7 +379,7 @@ <h4 class="method" id="method_foreign_key">foreign_key($class_name, $use_undersc
379379
</tbody>
380380
</table>
381381
</article>
382-
382+
383383
<article>
384384
<h4 class="method" id="method_friendly_title">friendly_title($str, $sep = '-', $lowercase = false)</h4>
385385
<p>The <strong>friendly_title</strong> method allows you to convert your text to a URL-friendly title so that it can be used in the URL. It only works with UTF-8 input and outputs 7 bit ASCII characters.</p>
@@ -430,7 +430,7 @@ <h4 class="method" id="method_friendly_title">friendly_title($str, $sep = '-', $
430430
</tbody>
431431
</table>
432432
</article>
433-
433+
434434
<article>
435435
<h4 class="method" id="method_humanize">humanize($lower_case_and_underscored_word)</h4>
436436
<p>The <strong>humanize</strong> method allows you to turn an underscore separated word and turns it into a human looking string.</p>
@@ -470,7 +470,7 @@ <h4 class="method" id="method_humanize">humanize($lower_case_and_underscored_wor
470470
</tbody>
471471
</table>
472472
</article>
473-
473+
474474
<article>
475475
<h4 class="method" id="method_is_countable">is_countable($word)</h4>
476476
<p>The <strong>is_countable</strong> method allows you check if the given word has a plural version.</p>
@@ -511,7 +511,7 @@ <h4 class="method" id="method_is_countable">is_countable($word)</h4>
511511
</tbody>
512512
</table>
513513
</article>
514-
514+
515515
<article>
516516
<h4 class="method" id="method_pluralize">pluralize($word)</h4>
517517
<p>The <strong>pluralize</strong> method allows you get the plural version of the given word.</p>
@@ -551,7 +551,47 @@ <h4 class="method" id="method_pluralize">pluralize($word)</h4>
551551
</tbody>
552552
</table>
553553
</article>
554-
554+
555+
<article>
556+
<h4 class="method" id="method_ordinalize">ordinalize($number)</h4>
557+
<p>The <strong>ordinalize</strong> method allows you to add english language order number suffixes.</p>
558+
<table class="method">
559+
<tbody>
560+
<tr>
561+
<th class="legend">Static</th>
562+
<td>Yes</td>
563+
</tr>
564+
<tr>
565+
<th>Parameters</th>
566+
<td>
567+
<table class="parameters">
568+
<tr>
569+
<th>Param</th>
570+
<th>Default</th>
571+
<th class="description">Description</th>
572+
</tr>
573+
<tr>
574+
<th><kbd>$number</kbd></th>
575+
<td><i>Required</i></td>
576+
<td>The number you want to ordinalize.</td>
577+
</tr>
578+
</table>
579+
</td>
580+
</tr>
581+
<tr>
582+
<th>Returns</th>
583+
<td>string</td>
584+
</tr>
585+
<tr>
586+
<th>Example</th>
587+
<td>
588+
<pre class="php"><code>echo Inflector::ordinalize(2); // returns 2nd</code></pre>
589+
</td>
590+
</tr>
591+
</tbody>
592+
</table>
593+
</article>
594+
555595
<article>
556596
<h4 class="method" id="method_singularize">singularize($word)</h4>
557597
<p>The <strong>singularize</strong> method allows you get the singular version of the given word.</p>
@@ -591,7 +631,7 @@ <h4 class="method" id="method_singularize">singularize($word)</h4>
591631
</tbody>
592632
</table>
593633
</article>
594-
634+
595635
<article>
596636
<h4 class="method" id="method_tableize">tableize($class_name)</h4>
597637
<p>The <strong>tableize</strong> method allows you to convert a class name to a table name.</p>
@@ -631,7 +671,7 @@ <h4 class="method" id="method_tableize">tableize($class_name)</h4>
631671
</tbody>
632672
</table>
633673
</article>
634-
674+
635675
<article>
636676
<h4 class="method" id="method_underscore">underscore($camel_cased_word)</h4>
637677
<p>The <strong>underscore</strong> method allows you to convert a CamelCased string into an underscore separated string.</p>
@@ -681,4 +721,4 @@ <h4 class="method" id="method_underscore">underscore($camel_cased_word)</h4>
681721
</footer>
682722
</div>
683723
</body>
684-
</html>
724+
</html>

0 commit comments

Comments
 (0)