[TYPO3-mvc] Validators via Typoscript

Pascal Jungblut mail at pascal-jungblut.com
Sat Aug 14 15:03:37 CEST 2010


Hi,

I couldn't find anything on this list regarding validation via typoscript. If this was already discussed, please let me know.

I think it would be very handy if one could set the validators for properties/objects with typoscript. When you publish an extension, you as the author decide which properties have to be validated. Users will have to change the source code to set different validators and that would break at every update. Just imagine the authors of sr_feuser_register (yes, your all-time favorite) decided for you which properties are required (@NotEmpty) and that a password must have 10 to 15 characters...

In the typoscript that could look like:

Tx_MyExt_Domain_Model_Foo {
	mapping {
		yadayada
	}
	validation {
		name = NotEmpty,Tx_MyExt_Validators_NoFilhtyNamesValidator
	}
}

And every user could configure this for himself, maybe just overriding the validators from the doc comments. What do you think? Maybe this is already possible and I just couldn't find it.
Another approach would be to write an own Tx_MyExt_Validators_TyposcriptValidator, ship it with my extension and apply it on every property.

Regards
Pascal


More information about the TYPO3-project-typo3v4mvc mailing list