Add this SilverStripe extension to any DataObject to automatically trim()
every text (ie, HTMLText, Text, VarChar) field before data is saved to the database.
#Installation
- copy the 'textfieldtrimmer' folder to the document root
- rebuild the manifest using /dev/build/?flush=all
- in the project code: on any DataObject that needs text fields trimmed, indicate that the DataObject is an 'extension' of TextFieldTrimmer, for example:
class Category extends DataObject {
static $extensions = array(
'TextFieldTrimmer',
);
...
}