FilterTestAssets.php
Same filename in other branches
Namespace
Drupal\filter_test\Plugin\FilterFile
-
core/
modules/ filter/ tests/ filter_test/ src/ Plugin/ Filter/ FilterTestAssets.php
View source
<?php
namespace Drupal\filter_test\Plugin\Filter;
use Drupal\filter\FilterProcessResult;
use Drupal\filter\Plugin\FilterBase;
/**
* Provides a test filter to attach assets.
*
* @Filter(
* id = "filter_test_assets",
* title = @Translation("Testing filter"),
* description = @Translation("Does not change content; attaches assets."),
* type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_REVERSIBLE
* )
*/
class FilterTestAssets extends FilterBase {
/**
* {@inheritdoc}
*/
public function process($text, $langcode) {
$result = new FilterProcessResult($text);
$result->addAttachments([
'library' => [
'filter/caption',
],
]);
return $result;
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
FilterTestAssets | Provides a test filter to attach assets. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.