You are here

public function WebformOptionsLimitController::index in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_options_limit/src/Controller/WebformOptionsLimitController.php \Drupal\webform_options_limit\Controller\WebformOptionsLimitController::index()

Returns the Webform submission export example CSV view.

1 string reference to 'WebformOptionsLimitController::index'
webform_options_limit.routing.yml in modules/webform_options_limit/webform_options_limit.routing.yml
modules/webform_options_limit/webform_options_limit.routing.yml

File

modules/webform_options_limit/src/Controller/WebformOptionsLimitController.php, line 51

Class

WebformOptionsLimitController
Provides route responses for webform options limit.

Namespace

Drupal\webform_options_limit\Controller

Code

public function index() {
  $webform = $this->requestHandler
    ->getCurrentWebform();
  $source_entity = $this->requestHandler
    ->getCurrentSourceEntity([
    'webform',
  ]);
  $build = [];
  $handlers = $webform
    ->getHandlers();
  foreach ($handlers as $handler) {
    if ($handler instanceof WebformOptionsLimitHandlerInterface) {
      $handler
        ->setSourceEntity($source_entity);
      $build[$handler
        ->getHandlerId()] = $handler
        ->buildSummaryTable();
      $build[$handler
        ->getHandlerId()]['#suffix'] = '<br/><br/>';
    }
  }
  return $build;
}