You are here

public function FilterInterface::prepare in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/filter/src/Plugin/FilterInterface.php \Drupal\filter\Plugin\FilterInterface::prepare()

Prepares the text for processing.

Filters should not use the prepare method for anything other than escaping, because that would short-circuit the control the user has over the order in which filters are applied.

Parameters

string $text: The text string to be filtered.

string $langcode: The language code of the text to be filtered.

Return value

string The prepared, escaped text.

1 method overrides FilterInterface::prepare()
FilterBase::prepare in core/modules/filter/src/Plugin/FilterBase.php
Prepares the text for processing.

File

core/modules/filter/src/Plugin/FilterInterface.php, line 157

Class

FilterInterface
Defines the interface for text processing filter plugins.

Namespace

Drupal\filter\Plugin

Code

public function prepare($text, $langcode);