Chapter 6. Zym_Filter

Chapter 6. Zym_Filter

6.1. Standard filter classes

6.1.1. Null

This filter does not do anything.

6.1.2. Nl2Br

Converts newlines to <br />'s

6.1.3. SentenceLength

Shortening a sentence (string $value) without chopping the string in the middle of words, and removes excessive whitespace.

On construction, the value for $maxLength may be set to specify max length of the filtered value. The default value is 128. If the param $replaceWihtespace is set false, the filter will not remove excessive whitespace.

6.1.4. Sprintf

Provides sprintf formatting of input.

6.1.5. UrlString

This filter extends the SentenceLength filter, and is used for filtering strings that are used in URLs. Example: The string "My fabolous blog article" would become "My-fabolous-blog-article" using default params. This filter has the constructor params $maxLength and $replaceWhitespace from Zym_Filter_SentenceLength, and adds params $encodeSlashes and $wordSeparator. The first will tell the filter to encode slashes using regular urlencode() (it is disabled by default since it causes problems with mod_rewrite), and the second param is used for specifying a separator to use instead of "-".