You are here

public function PatternsLibraryController::single in UI Patterns 8

Render pattern library page.

Parameters

string $name: Plugin ID.

Return value

array Return render array.

1 string reference to 'PatternsLibraryController::single'
ui_patterns_library.routing.yml in modules/ui_patterns_library/ui_patterns_library.routing.yml
modules/ui_patterns_library/ui_patterns_library.routing.yml

File

modules/ui_patterns_library/src/Controller/PatternsLibraryController.php, line 57

Class

PatternsLibraryController
Class PatternLibraryController.

Namespace

Drupal\ui_patterns_library\Controller

Code

public function single($name) {
  $definition = $this->patternsManager
    ->getDefinition($name);
  return [
    '#theme' => 'patterns_single_page',
    '#pattern' => [
      'meta' => [
        '#theme' => 'patterns_meta_information',
        '#pattern' => $definition
          ->toArray(),
      ],
      'rendered' => $this
        ->getPatternRenderArray($definition),
      'definition' => $definition
        ->toArray(),
    ],
  ];
}