summaryrefslogtreecommitdiffstats
path: root/user_guide/helpers
diff options
context:
space:
mode:
authorGreg Aker <greg.aker@ellislab.com>2010-08-05 21:09:20 +0200
committerGreg Aker <greg.aker@ellislab.com>2010-08-05 21:09:20 +0200
commitcbe3247819be75c34231ea200874044735bd853b (patch)
tree1545cc5f40bcf55b40fc14bd27179b0bf346fbf7 /user_guide/helpers
parent2ddc9496e9403a59a87b644d1c2b9a106b773e46 (diff)
Adding an ellipsize function to the text helper, and associated documentation to the user guide.
Diffstat (limited to 'user_guide/helpers')
-rw-r--r--user_guide/helpers/text_helper.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/user_guide/helpers/text_helper.html b/user_guide/helpers/text_helper.html
index d477f53a9..438eaec45 100644
--- a/user_guide/helpers/text_helper.html
+++ b/user_guide/helpers/text_helper.html
@@ -177,7 +177,19 @@ of text that will help<br />
us demonstrate this<br />
function</code>
+<h2>ellipsize()</h2>
+<p>This function will strip tags from a string, split it at a defined maximum length, and insert an ellipsis.</p>
+<p>The first parameter is the string to ellipsize, the second is the number of characters in the final string. The third parameter is where in the string the ellipsis should appear from 0 - 1, left to right. For example. a value of 1 will place the ellipsis at the right of the string, .5 in the middle, and 0 at the left.</p>
+<p>An optional forth parameter is the kind of ellipsis. By default, <samp>&amp;hellip;</samp> will be inserted.</p>
+
+<code>$str = 'this_string_is_entirely_too_long_and_might_break_my_design.jpg';<br />
+<br />
+echo ellipsize($str, 32, .5);</code>
+
+Produces:
+
+<code>this_string_is_e&hellip;ak_my_design.jpg</code>
</div>