You are here

public function BodyClass::execute in Context 8.4

Same name and namespace in other branches
  1. 8 src/Plugin/ContextReaction/BodyClass.php \Drupal\context\Plugin\ContextReaction\BodyClass::execute()

Executes the plugin.

Overrides ExecutableInterface::execute

File

src/Plugin/ContextReaction/BodyClass.php, line 37

Class

BodyClass
Provides a content reaction that adds a new css class.

Namespace

Drupal\context\Plugin\ContextReaction

Code

public function execute(array &$vars = []) {
  return [
    'class' => explode(' ', $this
      ->getConfiguration()['body_class']),
  ];
}