You are here

interface WebformElementAssetInterface in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformElementAssetInterface.php \Drupal\webform\Plugin\WebformElementAssetInterface

Defines the interface for webform elements with CSS and JavaScript assets.

Hierarchy

Expanded class hierarchy of WebformElementAssetInterface

All classes that implement WebformElementAssetInterface

2 files declare their use of WebformElementAssetInterface
Webform.php in src/Entity/Webform.php
WebformOptionsCustom.php in modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustom.php

File

src/Plugin/WebformElementAssetInterface.php, line 8

Namespace

Drupal\webform\Plugin
View source
interface WebformElementAssetInterface {

  /**
   * Determine if the element has assets.
   *
   * @return bool
   *   TRUE if the element has assets.
   */
  public function hasAssets();

  /**
   * Returns the webform element's asset ID.
   *
   * This is used to prevent duplicate CSS and JavaScript from being appended
   * to a webform.
   *
   * @return string
   *   The webform element's asset ID.
   */
  public function getAssetId();

  /**
   * Returns the webform element's CSS.
   *
   * @return string
   *   The webform element's CSS.
   */
  public function getCss();

  /**
   * Returns the webform element's JavaScript.
   *
   * @return string
   *   The webform element's CSS.
   */
  public function getJavaScript();

}

Members

Namesort descending Modifiers Type Description Overrides
WebformElementAssetInterface::getAssetId public function Returns the webform element's asset ID. 1
WebformElementAssetInterface::getCss public function Returns the webform element's CSS. 1
WebformElementAssetInterface::getJavaScript public function Returns the webform element's JavaScript. 1
WebformElementAssetInterface::hasAssets public function Determine if the element has assets. 1