What is the standard way to go about creating your own view helpers? I
would like to wrap a content area within a word_limiter() method but
not sure what the community standard practice is in accomplishing
this.

<code>def word_limiter(content, limit = 100, suffix = '...'):
  if len(content) <= limit:
    return content
  else:
    return content[:limit].rsplit(' ', 1)[0] + suffix</code>

Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to