3 namespace Drupal\filter_test\Plugin\Filter;
5 use Drupal\filter\FilterProcessResult;
6 use Drupal\filter\Plugin\FilterBase;
9 * Provides a test filter to associate cache tags
12 * id = "filter_test_cache_tags",
13 * title = @Translation("Testing filter"),
14 * description = @Translation("Does not change content; associates cache tags."),
15 * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
18 class FilterTestCacheTags extends FilterBase {
23 public function process($text, $langcode) {
24 $result = new FilterProcessResult($text);
25 $result->addCacheTags(['foo:bar']);
26 $result->addCacheTags(['foo:baz']);