class ContextualController implements ContainerInjectionInterface (View source)

Returns responses for Contextual module routes.

Properties

protected RendererInterface $renderer

The renderer.

Methods

__construct(RendererInterface $renderer)

Constructors a new ContextualController.

static 
create(ContainerInterface $container)

Instantiates a new instance of this class.

JsonResponse
render(Request $request)

Returns the requested rendered contextual links.

Details

__construct(RendererInterface $renderer)

Constructors a new ContextualController.

Parameters

RendererInterface $renderer

The renderer.

static create(ContainerInterface $container)

Instantiates a new instance of this class.

This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters

ContainerInterface $container

The service container this instance should use.

JsonResponse render(Request $request)

Returns the requested rendered contextual links.

Given a list of contextual links IDs, render them. Hence this must be robust to handle arbitrary input.

Parameters

Request $request

The Symfony request object.

Return Value

JsonResponse

The JSON response.

Exceptions

BadRequestHttpException

See also

contextual_preprocess()