Issue Feature Rejected

#64040Add filters via @filter annotations

Stefan Neufeind 12/25/14, 23:38 updated 01/15/20, 19:48

Description

Will allow things like trimming values that come from a form.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 5

  1. Stefan Neufeind commented and changed done 0 % 80 % 12/25/14, 23:39

    Existing implementation as an extension available at:
    https://github.com/AOEpeople/extbase_filter

  2. Alexander Schnitzler commented 02/14/15, 22:16

    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?

  3. Stefan Neufeind commented 02/15/15, 10:31

    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.

  4. Stefan Neufeind commented 02/15/15, 10:36

    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.

  5. Susanne Moog commented and changed status New Rejected 01/15/20, 19:48

    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.