You are here

protected function HttpServiceApiPreviewForm::buildOperations in HTTP Client Manager 8

Same name and namespace in other branches
  1. 8.2 src/Form/HttpServiceApiPreviewForm.php \Drupal\http_client_manager\Form\HttpServiceApiPreviewForm::buildOperations()

Build operations.

Parameters

string $serviceApi: The service api name.

string $commandName: The command name.

Return value

array An array of operations.

1 call to HttpServiceApiPreviewForm::buildOperations()
HttpServiceApiPreviewForm::buildForm in src/Form/HttpServiceApiPreviewForm.php
Form constructor.

File

src/Form/HttpServiceApiPreviewForm.php, line 275

Class

HttpServiceApiPreviewForm
Class HttpServiceApiPreviewForm.

Namespace

Drupal\http_client_manager\Form

Code

protected function buildOperations($serviceApi, $commandName) {
  return [
    '#type' => 'operations',
    '#links' => [
      'config_requests' => [
        'title' => $this
          ->t('Configured Requests (@count)', [
          '@count' => $this
            ->getConfigEntitiesCount('http_config_request', $serviceApi, $commandName),
        ]),
        'url' => Url::fromRoute('entity.http_config_request.collection', [
          'serviceApi' => $serviceApi,
          'commandName' => $commandName,
        ]),
        'attributes' => [
          'class' => 'http-client-manager-service-summary',
        ],
      ],
    ],
  ];
}