You are here

public function FormatSetter::__construct in JSON:API 8

Same name and namespace in other branches
  1. 8.2 src/StackMiddleware/FormatSetter.php \Drupal\jsonapi\StackMiddleware\FormatSetter::__construct()

Constructs a FormatSetter object.

Parameters

\Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel: The decorated kernel.

string $jsonapi_base_path: The JSON API base path.

File

src/StackMiddleware/FormatSetter.php, line 38

Class

FormatSetter
Sets the 'api_json' format on all requests to JSON API-managed routes.

Namespace

Drupal\jsonapi\StackMiddleware

Code

public function __construct(HttpKernelInterface $http_kernel, $jsonapi_base_path) {
  $this->httpKernel = $http_kernel;
  $this->jsonApiBasePath = $jsonapi_base_path;
}