class LayoutBuilderController
Same name in other branches
- 8.9.x 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
- 11.x 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 \Drupal\Core\StringTranslation\StringTranslationTrait
Expanded class hierarchy of LayoutBuilderController
File
-
core/
modules/ layout_builder/ src/ Controller/ LayoutBuilderController.php, line 15
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) {
assert(Inspector::assertStringable($section_storage->label()), 'Section storage label is expected to be a string.');
return $this->t('Edit layout for %label', [
'%label' => $section_storage->label() ?? $section_storage->getStorageType() . ' ' . $section_storage->getStorageId(),
]);
}
/**
* 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
Title Sort descending | Modifiers | Object type | Summary | Overrides |
---|---|---|---|---|
LayoutBuilderController::layout | public | function | Renders the Layout UI. | |
LayoutBuilderController::title | public | function | Provides a title callback. | |
StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | 3 |
StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | |
StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | |
StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.