FilterTestReplace.php
Same filename in other branches
Namespace
Drupal\filter_test\Plugin\FilterFile
-
core/
modules/ filter/ tests/ filter_test/ src/ Plugin/ Filter/ FilterTestReplace.php
View source
<?php
declare (strict_types=1);
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 replace all content.
*/
class FilterTestReplace extends FilterBase {
/**
* {@inheritdoc}
*/
public function process($text, $langcode) {
$text = [];
$text[] = 'Filter: ' . $this->getLabel() . ' (' . $this->getPluginId() . ')';
$text[] = 'Language: ' . $langcode;
return new FilterProcessResult(implode("<br />\n", $text));
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
FilterTestReplace | Provides a test filter to replace all content. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.