rah_trim
Published under current TXP projects
Container tag for Textpattern CMS that allows you to strip appending and prepending whitespace from a string. Works just like when PHP’s ltrim(), rtrim() and trim() joined forces.
Image: rah_trim
Requirements
- PHP 4.3.0+
- Textpattern 4.x.x+
Installation and usage
The general behavior stands: paste plugin code to the plugin installer textarea and run the automatic setup. Then just activate the plugin and you are ready to use new tags that plugin includes like others.
Attributes
The tag, <txp:rah_trim>, is a container tag and attributes for it follow.
direction
Which end of a string to strip. Available values left, right and both.
Example: direction="left" Default: "both"
charlist
Custom characters to be stripped. If left to unset, the tag will strip " ", \t, \n, \r, \0 and \x0b. Default is unset.
Example: charlist="\t,a,b,c" Default: "" (unset)
Example
<txp:rah_trim direction="left">
Our site's name:
<txp:site_name />
</txp:rah_trim>
Changelog
Version 0.1
- First release