class LayoutBuilderController in Drupal 8
Same name and namespace in other branches
- 9 core/modules/layout_builder/src/Controller/LayoutBuilderController.php \Drupal\layout_builder\Controller\LayoutBuilderController
- 10 core/modules/layout_builder/src/Controller/LayoutBuilderController.php \Drupal\layout_builder\Controller\LayoutBuilderController
Defines a controller to provide the Layout Builder admin UI.
@internal Controller classes are internal.
Hierarchy
- class \Drupal\layout_builder\Controller\LayoutBuilderController uses StringTranslationTrait
Expanded class hierarchy of LayoutBuilderController
File
- core/
modules/ layout_builder/ src/ Controller/ LayoutBuilderController.php, line 14
Namespace
Drupal\layout_builder\ControllerView source
class LayoutBuilderController {
use StringTranslationTrait;
/**
* Provides a title callback.
*
* @param \Drupal\layout_builder\SectionStorageInterface $section_storage
* The section storage.
*
* @return string
* The title for the layout page.
*/
public function title(SectionStorageInterface $section_storage) {
return $this
->t('Edit layout for %label', [
'%label' => $section_storage
->label(),
]);
}
/**
* Renders the Layout UI.
*
* @param \Drupal\layout_builder\SectionStorageInterface $section_storage
* The section storage.
*
* @return array
* A render array.
*/
public function layout(SectionStorageInterface $section_storage) {
return [
'#type' => 'layout_builder',
'#section_storage' => $section_storage,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LayoutBuilderController:: |
public | function | Renders the Layout UI. | |
LayoutBuilderController:: |
public | function | Provides a title callback. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |