function LayoutDerivativesTest::renderLayoutDemonstration in Layout 8.2
Renders the layout with sample region content.
Parameters
\Drupal\layout\Plugin\LayoutInterface $layout: The layout to be rendered.
Return value
string Rendered HTML output from the layout.
1 call to LayoutDerivativesTest::renderLayoutDemonstration()
- LayoutDerivativesTest::testDerivatives in lib/
Drupal/ layout/ Tests/ LayoutDerivativesTest.php - Tests for module/theme layout derivatives.
File
- lib/
Drupal/ layout/ Tests/ LayoutDerivativesTest.php, line 87 - Definition of Drupal\layout\Tests\LayoutDerivativesTest.
Class
- LayoutDerivativesTest
- Tests the layout system derivatives.
Namespace
Drupal\layout\TestsCode
function renderLayoutDemonstration($layout) {
// Add sample content in the regions that is looked for in the tests.
$regions = $layout
->getRegions();
foreach ($regions as $region => $info) {
$regions[$region] = '<h3>' . $info['label'] . '</h3>';
}
return $layout
->renderLayout(FALSE, $regions);
}