You are here

class WebformSharePreRender in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_share/src/WebformSharePreRender.php \Drupal\webform_share\WebformSharePreRender

Implements trusted prerender callbacks for the Webform share module.

@internal

Hierarchy

Expanded class hierarchy of WebformSharePreRender

1 file declares its use of WebformSharePreRender
webform_share.module in modules/webform_share/webform_share.module
Allows webforms to be shared on other websites using an iframe.

File

modules/webform_share/src/WebformSharePreRender.php, line 12

Namespace

Drupal\webform_share
View source
class WebformSharePreRender implements TrustedCallbackInterface {

  /**
   * Prerender callback for page.
   */
  public static function page($element) {
    if (!WebformShareHelper::isPage()) {
      return $element;
    }

    // Remove all theme wrappers from the page template.
    $element['#theme_wrappers'] = [];
    return $element;
  }

  /**
   * {@inheritdoc}
   */
  public static function trustedCallbacks() {
    return [
      'page',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING constant Untrusted callbacks trigger E_USER_WARNING errors.
WebformSharePreRender::page public static function Prerender callback for page.
WebformSharePreRender::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface::trustedCallbacks