diff --git a/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php index ff90824..440b2b7 100644 --- a/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php +++ b/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php @@ -102,7 +102,7 @@ public function __construct(TitleResolverInterface $title_resolver, PluginManage /** * {@inheritdoc} * - * The entire HTML: takes a #type 'page' and wraps it in a #type 'html'. + * The entire HTML: takes a #type 'body' and wraps it in a #type 'html'. */ public function renderResponse(array $main_content, Request $request, RouteMatchInterface $route_match) { list($page, $title) = $this->prepare($main_content, $request, $route_match); @@ -142,7 +142,7 @@ public function renderResponse(array $main_content, Request $request, RouteMatch } /** - * Prepares the HTML body: wraps the main content in #type 'page'. + * Prepares the HTML body: wraps the main content in #type 'body'. * * @param array $main_content * The render array representing the main content. @@ -153,20 +153,20 @@ public function renderResponse(array $main_content, Request $request, RouteMatch * * @return array * An array with two values: - * 0. A #type 'page' render array. + * 0. A #type 'body' render array. * 1. The page title. * * @throws \LogicException * If the selected display variant does not implement PageVariantInterface. */ protected function prepare(array $main_content, Request $request, RouteMatchInterface $route_match) { - // If the _controller result already is #type => page, + // If the _controller result already is #type => body, // we have no work to do: The "main content" already is an entire "page" // (see html.html.twig). - if (isset($main_content['#type']) && $main_content['#type'] === 'page') { + if (isset($main_content['#type']) && $main_content['#type'] === 'body') { $page = $main_content; } - // Otherwise, render it as the main content of a #type => page, by selecting + // Otherwise, render it as the main content of a #type => body, by selecting // page display variant to do that and building that page display variant. else { // Select the page display variant to be used to render this main content, @@ -205,7 +205,7 @@ protected function prepare(array $main_content, Request $request, RouteMatchInte ->setMainContent($main_content) ->setConfiguration($event->getPluginConfiguration()); - // Generate a #type => page render array using the page display variant, + // Generate a #type => body render array using the page display variant, // the page display will build the content for the various page regions. $page = array( '#type' => 'body', @@ -237,7 +237,7 @@ protected function prepare(array $main_content, Request $request, RouteMatchInte * Invokes the page attachment hooks. * * @param array &$page - * A #type 'page' render array, for which the page attachment hooks will be + * A #type 'body' render array, for which the page attachment hooks will be * invoked and to which the results will be added. * * @throws \LogicException diff --git a/core/modules/block/src/Controller/BlockController.php b/core/modules/block/src/Controller/BlockController.php index 1bb926a..e7ddb2c 100644 --- a/core/modules/block/src/Controller/BlockController.php +++ b/core/modules/block/src/Controller/BlockController.php @@ -51,7 +51,7 @@ public static function create(ContainerInterface $container) { * The name of the theme. * * @return array - * A #type 'page' render array containing the block region demo. + * A #type 'body' render array containing the block region demo. */ public function demo($theme) { $page = [ diff --git a/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php b/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php index 75894ec..440584b 100644 --- a/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php @@ -122,13 +122,13 @@ public function providerTestGetInfo() { $data = array(); // Provide an element and expect it is returned. $data[] = array( - 'page', + 'body', array( '#type' => 'body', '#theme' => 'page', '#defaults_loaded' => TRUE, ), - array('page' => array( + array('body' => array( '#theme' => 'page', )), ); @@ -138,24 +138,24 @@ public function providerTestGetInfo() { array( '#defaults_loaded' => TRUE, ), - array('page' => array( + array('body' => array( '#theme' => 'page', )), ); // Provide an element and alter it to ensure it is altered. $data[] = array( - 'page', + 'body', array( '#type' => 'body', '#theme' => 'page', '#number' => 597219, '#defaults_loaded' => TRUE, ), - array('page' => array( + array('body' => array( '#theme' => 'page', )), function ($alter_name, array &$info) { - $info['page']['#number'] = 597219; + $info['body']['#number'] = 597219; } ); return $data; @@ -197,15 +197,15 @@ public function testGetInfoElementPlugin($plugin_class, $expected_info) { $element_info->expects($this->once()) ->method('createInstance') - ->with('page') + ->with('body') ->willReturn($plugin); $element_info->expects($this->once()) ->method('getDefinitions') ->willReturn(array( - 'page' => array('class' => 'TestElementPlugin'), + 'body' => array('class' => 'TestElementPlugin'), )); - $this->assertEquals($expected_info, $element_info->getInfo('page')); + $this->assertEquals($expected_info, $element_info->getInfo('body')); } /**