You are here

public function ShortcodeBase::render in Shortcode 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/ShortcodeBase.php \Drupal\shortcode\Plugin\ShortcodeBase::render()

Wrapper for renderPlain.

We use renderplain so that the shortcode's cache tags would not bubble up to the parent and affect cacheability. Shortcode should be part of content and self-container.

Parameters

array $elements: The structured array describing the data to be rendered.

Return value

\Drupal\Component\Render\MarkupInterface|mixed Element stripped of any bubbleable metadata.

7 calls to ShortcodeBase::render()
ButtonShortcode::process in shortcode_basic_tags/src/Plugin/Shortcode/ButtonShortcode.php
Performs the shortcode processing.
ClearShortcode::process in shortcode_basic_tags/src/Plugin/Shortcode/ClearShortcode.php
Performs the shortcode processing.
DropcapShortcode::process in shortcode_basic_tags/src/Plugin/Shortcode/DropcapShortcode.php
Performs the shortcode processing.
ImageShortcode::process in shortcode_basic_tags/src/Plugin/Shortcode/ImageShortcode.php
Performs the shortcode processing.
ItemShortcode::process in shortcode_basic_tags/src/Plugin/Shortcode/ItemShortcode.php
Performs the shortcode processing.

... See full list

File

src/Plugin/ShortcodeBase.php, line 387

Class

ShortcodeBase
Provides a base class for Shortcode plugins.

Namespace

Drupal\shortcode\Plugin

Code

public function render(array &$elements) {

  /** @var \Drupal\Core\Render\Renderer $renderer */
  $renderer = \Drupal::service('renderer');
  return $renderer
    ->renderPlain($elements);
}