interface TagPluginInterface in Extensible BBCode 8.3
Same name and namespace in other branches
- 4.0.x src/Plugin/TagPluginInterface.php \Drupal\xbbcode\Plugin\TagPluginInterface
Defines the interface for XBBCode tag plugins.
Hierarchy
- interface \Drupal\xbbcode\Parser\Processor\TagProcessorInterface; interface \Drupal\Component\Plugin\PluginInspectionInterface
- interface \Drupal\xbbcode\Plugin\TagPluginInterface
Expanded class hierarchy of TagPluginInterface
All classes that implement TagPluginInterface
See also
XBBCodeTag
3 files declare their use of TagPluginInterface
- TagPluginManager.php in src/
TagPluginManager.php - TagSetForm.php in src/
Form/ TagSetForm.php - XBBCodeFilter.php in src/
Plugin/ Filter/ XBBCodeFilter.php
File
- src/
Plugin/ TagPluginInterface.php, line 17
Namespace
Drupal\xbbcode\PluginView source
interface TagPluginInterface extends TagProcessorInterface, PluginInspectionInterface {
/**
* Returns the status of this tag plugin.
*
* @return bool
* Plugin status.
*/
public function status() : bool;
/**
* Returns the administrative label for this tag plugin.
*
* @return string
* Plugin label.
*/
public function label() : string;
/**
* Returns the administrative description for this tag plugin.
*
* @return string
* Plugin description.
*/
public function getDescription() : string;
/**
* Returns the configured name.
*
* @return string
* The tag name.
*/
public function getName() : string;
/**
* Returns the default tag name.
*
* @return string
* Plugin default name.
*/
public function getDefaultName() : string;
/**
* Return the unprocessed sample code.
*
* This should have {{ name }} placeholders for the tag name.
*
* @return string
* The sample code.
*/
public function getDefaultSample() : string;
/**
* Return a sample tag for the filter tips.
*
* This sample should reference the configured tag name.
*
* @return string
* The sample code.
*/
public function getSample() : string;
/**
* Generate output from a tag element.
*
* @param \Drupal\xbbcode\Parser\Tree\TagElementInterface $tag
* The tag element to process.
*
* @return \Drupal\xbbcode\Parser\Tree\OutputElementInterface
* Actually a TagProcessResult, but PHP does not support covariant types.
*
* @TODO: Add covariant type hints after PHP 7.4 is required.
*
* @see \Drupal\xbbcode\TagProcessResult
*/
public function process(TagElementInterface $tag) : OutputElementInterface;
/**
* Transform an elements' content, to armor against other filters.
*
* - Use the inner content if all children will be rendered.
* (This just means the children's own ::prepare() functions are used.)
* - Use $tag->getSource() if no children will be rendered.
* - Traverse the tag's descendants for more complex cases.
*
* @param string $content
* The content, after applying inner transformations.
* @param \Drupal\xbbcode\Parser\Tree\TagElementInterface $tag
* The original tag element.
*
* @return string
* The prepared output.
*/
public function prepare(string $content, TagElementInterface $tag) : string;
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |
TagPluginInterface:: |
public | function | Returns the default tag name. | 1 |
TagPluginInterface:: |
public | function | Return the unprocessed sample code. | 1 |
TagPluginInterface:: |
public | function | Returns the administrative description for this tag plugin. | 1 |
TagPluginInterface:: |
public | function | Returns the configured name. | 1 |
TagPluginInterface:: |
public | function | Return a sample tag for the filter tips. | 1 |
TagPluginInterface:: |
public | function | Returns the administrative label for this tag plugin. | 1 |
TagPluginInterface:: |
public | function | Transform an elements' content, to armor against other filters. | 1 |
TagPluginInterface:: |
public | function |
Generate output from a tag element. Overrides TagProcessorInterface:: |
1 |
TagPluginInterface:: |
public | function | Returns the status of this tag plugin. | 1 |