From cde712ce354dcfd69f9c5e2b56ef7d6f1206d11a Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Fri, 9 Dec 2011 11:27:51 -0500 Subject: Added ability to change the separator value in the humanize function --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/helpers/inflector_helper.rst | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 205b087f5..6f41f4519 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -33,6 +33,7 @@ Release Date: Not Released - url_title() will now trim extra dashes from beginning and end. - Added XHTML Basic 1.1 doctype to :doc:`HTML Helper `. + - Changed humanize to include a second param for the separator. - Database diff --git a/user_guide_src/source/helpers/inflector_helper.rst b/user_guide_src/source/helpers/inflector_helper.rst index cf246b9de..cc46a1851 100644 --- a/user_guide_src/source/helpers/inflector_helper.rst +++ b/user_guide_src/source/helpers/inflector_helper.rst @@ -77,3 +77,9 @@ them. Each word is capitalized. Example $word = "my_dog_spot"; echo humanize($word); // Returns "My Dog Spot" +To use dashes instead of underscores + +:: + + $word = "my-dog-spot"; + echo humanize($word, '-'); // Returns "My Dog Spot" \ No newline at end of file -- cgit v1.2.3-24-g4f1b