FilterTestCacheTags.php
Same filename in other branches
Namespace
Drupal\filter_test\Plugin\FilterFile
-
core/
modules/ filter/ tests/ filter_test/ src/ Plugin/ Filter/ FilterTestCacheTags.php
View source
<?php
namespace Drupal\filter_test\Plugin\Filter;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\filter\Attribute\Filter;
use Drupal\filter\FilterProcessResult;
use Drupal\filter\Plugin\FilterBase;
use Drupal\filter\Plugin\FilterInterface;
/**
* Provides a test filter to associate cache tags.
*/
class FilterTestCacheTags extends FilterBase {
/**
* {@inheritdoc}
*/
public function process($text, $langcode) {
$result = new FilterProcessResult($text);
$result->addCacheTags([
'foo:bar',
]);
$result->addCacheTags([
'foo:baz',
]);
return $result;
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
FilterTestCacheTags | Provides a test filter to associate cache tags. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.