We need plugins for formatting typed data, e.g. to format a date using a date format.

Comments

fago created an issue. See original summary.

fago’s picture

Title: Add token formatting plugins » Add data filter plugins

Given our plans to be twig compatible, we should call this "filters":
https://www.drupal.org/node/2357633
http://jinja.pocoo.org/docs/dev/templates/#builtin-filters
http://jinja.pocoo.org/docs/dev/templates/#builtin-filters

Note that filtering is more generic than formatting, else e.g. default() is no formatter. Also, many filters would work as data processors, but not all of them - so let's keep that separated.

fago’s picture

fago’s picture

Status: Active » Needs review
fago’s picture

fago’s picture

Status: Needs review » Fixed

Merged it.

  • fago committed 4481a13 on 8.x-3.x
    Issue #2650440 by fago: Add test coverage for data filters and make them...
  • fago committed 5a68cf9 on 8.x-3.x
    Issue #2650440 by fago: Add initial architecture and prototyped plugins...
  • fago committed e6bf331 on 8.x-3.x
    Issue #2650440 by fago: Fix DataFilterInterface documentation.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.