getBuild example

'#cache' => [
        'contexts' => [],
        'tags' => [
          'build-tag',
          'test',
        ],
        'max-age' => -1,
      ],
    ];

    $subscriber->onBuildRender($event);
    $result = $event->getBuild();
    $this->assertEquals($expected_build$result);
    $event->getCacheableMetadata()->applyTo($result);
    $this->assertEqualsCanonicalizing($expected_build_with_expected_cache['#cache']$result['#cache']);
  }

  /** * @covers ::onBuildRender * * @dataProvider providerBlockTypes */
  public function testOnBuildRenderWithoutPreviewFallbackString($refinable_dependent_access) {
    

  public function toRenderArray(array $contexts = []$in_preview = FALSE) {
    $event = new SectionComponentBuildRenderArrayEvent($this$contexts$in_preview);
    $this->eventDispatcher()->dispatch($event, LayoutBuilderEvents::SECTION_COMPONENT_BUILD_RENDER_ARRAY);
    $output = $event->getBuild();
    $event->getCacheableMetadata()->applyTo($output);
    return $output;
  }

  /** * Gets any arbitrary property for the component. * * @param string $property * The property to retrieve. * * @return mixed * The value for that property, or NULL if the property does not exist. */
Home | Imprint | This part of the site doesn't use cookies.