You are here

public static function SchemaMetatagManager::renderArrayJsonLd in Schema.org Metatag 8

Same name and namespace in other branches
  1. 8.2 src/SchemaMetatagManager.php \Drupal\schema_metatag\SchemaMetatagManager::renderArrayJsonLd()

Create the JSON LD render array.

Parameters

string $jsonld: The JSONLD string value.

Return value

array A render array for the JSONLD, .

Overrides SchemaMetatagManagerInterface::renderArrayJsonLd

1 call to SchemaMetatagManager::renderArrayJsonLd()
SchemaMetatagManager::getRenderedJsonld in src/SchemaMetatagManager.php
Render JSON LD for a specific entity.

File

src/SchemaMetatagManager.php, line 64

Class

SchemaMetatagManager
Class SchemaMetatagManager.

Namespace

Drupal\schema_metatag

Code

public static function renderArrayJsonLd($jsonld) {
  return [
    '#type' => 'html_tag',
    '#tag' => 'script',
    '#value' => $jsonld,
    '#attributes' => [
      'type' => 'application/ld+json',
    ],
  ];
}