You are here

public static function FocalPointImageWidget::getPreviewToken in Focal Point 8

Create and return a token to use for accessing the preview page.

@codeCoverageIgnore

Return value

string A valid token.

1 call to FocalPointImageWidget::getPreviewToken()
FocalPointImageWidget::createPreviewLink in src/Plugin/Field/FieldWidget/FocalPointImageWidget.php
Create the preview link form element.

File

src/Plugin/Field/FieldWidget/FocalPointImageWidget.php, line 230

Class

FocalPointImageWidget
Plugin implementation of the 'image_focal_point' widget.

Namespace

Drupal\focal_point\Plugin\Field\FieldWidget

Code

public static function getPreviewToken() {
  return \Drupal::csrfToken()
    ->get(self::PREVIEW_TOKEN_NAME);
}