Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Add this SilverStripe extension to any DataObject to automatically `trim()` every field before data is saved to the database.

License

Notifications You must be signed in to change notification settings

Marketo/SilverStripe-TextFieldTrimmer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextFieldTrimmer-for-SilverStripe

Description

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

  1. copy the 'textfieldtrimmer' folder to the document root
  2. rebuild the manifest using /dev/build/?flush=all
  3. 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',
	);
    ...
}

About

Add this SilverStripe extension to any DataObject to automatically `trim()` every field before data is saved to the database.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages