public function FilterFormat::filters

Returns the collection of filter pugin instances or an individual plugin instance.

Parameters

string $instance_id: (optional) The ID of a filter plugin instance to return.

Return value

\Drupal\filter\FilterBag|\Drupal\filter\Plugin\FilterInterface Either the filter bag or a specific filter plugin instance.

Overrides FilterFormatInterface::filters

File

drupal/core/modules/filter/lib/Drupal/filter/Plugin/Core/Entity/FilterFormat.php, line 134
Contains \Drupal\filter\Plugin\Core\Entity\FilterFormat.

Class

FilterFormat
Represents a text format.

Namespace

Drupal\filter\Plugin\Core\Entity

Code

public function filters($instance_id = NULL) {
  if (!isset($this->filterBag)) {
    $this->filterBag = new FilterBag(\Drupal::service('plugin.manager.filter'), $this->filters);
  }
  if (isset($instance_id)) {
    return $this->filterBag
      ->get($instance_id);
  }
  return $this->filterBag;
}