dojox/dtl/filter/strings (version 1.10)

Property Summary

Method Summary

  • _urlquote(url,safe)
  • addslashes(value) Adds slashes - useful for passing strings to JavaScript, for example.
  • capfirst(value) Capitalizes the first character of the value
  • center(value,arg) Centers the value in a field of a given width
  • cut(value,arg) Removes all values of arg from the given string
  • fix_ampersands(value) Replaces ampersands with & entities
  • floatformat(value,arg) Format a number according to arg
  • iriencode(value)
  • linenumbers(value) Displays text with line numbers
  • ljust(value,arg)
  • lower(value) Converts a string into all lowercase
  • make_list(value) Returns the value turned into a list.
  • rjust(value,arg)
  • slugify(value) Converts to lowercase, removes non-alpha chars and converts spaces to hyphens
  • stringformat(value,arg) Formats the variable according to the argument, a string formatting specifier.
  • title(value) Converts a string into titlecase
  • truncatewords(value,arg) Truncates a string after a certain number of words
  • truncatewords_html(value,arg)
  • upper(value)
  • urlencode(value)
  • urlize(value)
  • urlizetrunc(value,arg)
  • wordcount(value)
  • wordwrap(value,arg)

Properties

_fix_ampersands
_strings
_truncate_singlets
_truncate_tag
_truncate_words
_truncatewords
_urlize
_urlize2

Methods

_urlquote(url,safe)
Parameter Type Description
url String
safe String
Optional
Returns:undefined
addslashes(value)

Adds slashes - useful for passing strings to JavaScript, for example.

Parameter Type Description
value undefined
Returns:undefined
capfirst(value)

Capitalizes the first character of the value

Parameter Type Description
value undefined
Returns:number
center(value,arg)

Centers the value in a field of a given width

Parameter Type Description
value undefined
arg undefined
Returns:string
cut(value,arg)

Removes all values of arg from the given string

Parameter Type Description
value undefined
arg undefined
Returns:undefined
fix_ampersands(value)

Replaces ampersands with & entities

Parameter Type Description
value undefined
Returns:undefined
floatformat(value,arg)

Format a number according to arg

If called without an argument, displays a floating point number as 34.2 -- but only if there's a point to be displayed. With a positive numeric argument, it displays that many decimal places always. With a negative numeric argument, it will display that many decimal places -- but only if there's places to be displayed.

Parameter Type Description
value undefined
arg undefined
Returns:undefined
iriencode(value)
Parameter Type Description
value undefined
Returns:undefined
linenumbers(value)

Displays text with line numbers

Parameter Type Description
value undefined
Returns:undefined
ljust(value,arg)
Parameter Type Description
value undefined
arg undefined
Returns:string
lower(value)

Converts a string into all lowercase

Parameter Type Description
value undefined
Returns:undefined
make_list(value)

Returns the value turned into a list. For an integer, it's a list of digits. For a string, it's a list of characters.

Parameter Type Description
value undefined
Returns:Array
rjust(value,arg)
Parameter Type Description
value undefined
arg undefined
Returns:string
slugify(value)

Converts to lowercase, removes non-alpha chars and converts spaces to hyphens

Parameter Type Description
value undefined
Returns:undefined
stringformat(value,arg)

Formats the variable according to the argument, a string formatting specifier. This specifier uses Python string formatting syntax, with the exception that the leading "%" is dropped.

Parameter Type Description
value undefined
arg undefined
Returns:undefined
title(value)

Converts a string into titlecase

Parameter Type Description
value undefined
Returns:string
truncatewords(value,arg)

Truncates a string after a certain number of words

Parameter Type Description
value undefined
arg Integer

Number of words to truncate after

Returns:undefined | string
truncatewords_html(value,arg)
Parameter Type Description
value undefined
arg undefined
Returns:string
upper(value)
Parameter Type Description
value undefined
Returns:undefined
urlencode(value)
Parameter Type Description
value undefined
Returns:undefined
urlize(value)
Parameter Type Description
value undefined
Returns:undefined
urlizetrunc(value,arg)
Parameter Type Description
value undefined
arg undefined
Returns:undefined
wordcount(value)
Parameter Type Description
value undefined
Returns:number | undefined
wordwrap(value,arg)
Parameter Type Description
value String

alias name: 'cent', 'pound' ..

arg undefined
Returns:undefined
Error in the documentation? Can’t find what you are looking for? Let us know!