Feature #64040
closedAdd filters via @filter annotations
80%
Description
Will allow things like trimming values that come from a form.
Updated by Stefan Neufeind almost 10 years ago
- % Done changed from 0 to 80
Existing implementation as an extension available at:
https://github.com/AOEpeople/extbase_filter
Updated by Alexander Schnitzler almost 10 years ago
imho this is view logic and not business logic and therefore doesn't belong into yet another annotation that unnecessarily slows down Extbase again.
There is a reason why frontend frameworks like angularjs implement a huge set of filters:
https://docs.angularjs.org/api/ng/filter/filter
If you need to adjust your model data, why not simply use the getter?
Updated by Stefan Neufeind almost 10 years ago
We already have validators in Extbase. They can however just check data and allow or disallow them. And from the action there is imho no easy way to hook in before the validators. For example if you have a validator that a certain value must not be empty, there currently is no (easy) way to first trim that field before checking.
The "workaround" to still be able to use those validators is to use a separate initialize-method for each action, where you can access and manipulate the arguments. Or you'd have to skip using the validators by annotations altogether, inside your action process the input first and then do the validation yourself.
Imho having filters as a counterpart for the validators makes sense.
Updated by Stefan Neufeind almost 10 years ago
About implementing that as an extension: As you see in the extension from AOE imho the work required to implement such a concept using an extension is quite "huge". Just adding a filter-interface and calling filters if they are defined would only be a small addition if we'd add it to Extbase/Flow.
Updated by Susanne Moog almost 5 years ago
- Status changed from New to Rejected
As there was no buzz here for the last 5 years I'm going to close this issue due to low demand. If there is still a need please open a new ticket - think about whether this kind of implementation would still be state of the art or if a custom event for example might be a more modern solution.