class Filter

Same name and namespace in other branches
  1. 11.x core/modules/filter/src/Attribute/Filter.php \Drupal\filter\Attribute\Filter

Defines a filter attribute for plugin discovery.

Plugin Namespace: Plugin\Filter

For a working example, see \Drupal\filter\Plugin\Filter\FilterHtml

Attributes

#[\Attribute(\Attribute::TARGET_CLASS)]

Hierarchy

Expanded class hierarchy of Filter

See also

\Drupal\filter\FilterPluginManager

\Drupal\filter\Plugin\FilterInterface

\Drupal\filter\Plugin\FilterBase

Plugin API

1 file declares its use of Filter
FilterImageLazyLoad.php in core/modules/filter/src/Plugin/Filter/FilterImageLazyLoad.php
23 string references to 'Filter'
AreaTextTokenTest::setUp in core/modules/views/tests/src/Kernel/Handler/AreaTextTokenTest.php
BulkOperationsTest::testBulkOperations in core/modules/views/tests/src/FunctionalJavascript/Plugin/BulkOperationsTest.php
ConfigTranslationUiSiteInformationTest::testSiteInformationTranslationUi in core/modules/config_translation/tests/src/Functional/ConfigTranslationUiSiteInformationTest.php
Tests the site information translation interface.
filter.format.basic_html.yml in core/recipes/basic_html_format_editor/config/filter.format.basic_html.yml
core/recipes/basic_html_format_editor/config/filter.format.basic_html.yml
filter.format.full_html.yml in core/recipes/full_html_format_editor/config/filter.format.full_html.yml
core/recipes/full_html_format_editor/config/filter.format.full_html.yml

... See full list

File

core/modules/filter/src/Attribute/Filter.php, line 22

Namespace

Drupal\filter\Attribute
View source
class Filter extends Plugin {
  
  /**
   * Constructs a Filter attribute.
   *
   * @param string $id
   *   The plugin ID.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup $title
   *   The human-readable name of the filter. This is used as an administrative
   *   summary of what the filter does.
   * @param int $type
   *   The filter type. Values are defined in
   *   \Drupal\filter\Plugin\FilterInterface.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
   *   (optional) Additional administrative information about the filter's
   *   behavior.
   * @param int $weight
   *   (optional) A default weight for the filter in new text formats.
   * @param bool $status
   *   (optional) Whether this filter is enabled or disabled by default.
   * @param array $settings
   *   (optional) The default settings for the filter.
   */
  public function __construct(public readonly string $id, public readonly TranslatableMarkup $title, public readonly int $type, public readonly ?TranslatableMarkup $description = NULL, public readonly int $weight = 0, public readonly bool $status = FALSE, public readonly array $settings = []) {
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AttributeBase::$class protected property The class used for this attribute class.
AttributeBase::$provider protected property The provider of the attribute class.
AttributeBase::get public function Gets the value of an attribute. Overrides AttributeInterface::get 6
AttributeBase::getClass public function Gets the class of the attribute class. Overrides AttributeInterface::getClass 1
AttributeBase::getId public function Gets the unique ID for this attribute class. Overrides AttributeInterface::getId
AttributeBase::getProvider public function Gets the name of the provider of the attribute class. Overrides AttributeInterface::getProvider
AttributeBase::setClass public function Sets the class of the attributed class. Overrides AttributeInterface::setClass 1
AttributeBase::setProvider public function Sets the name of the provider of the attribute class. Overrides AttributeInterface::setProvider
Filter::__construct public function Constructs a Filter attribute. Overrides Plugin::__construct

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.