class MachineNameController implements ContainerInjectionInterface (View source)

Controller routines for machine name transliteration routes.

Properties

protected TransliterationInterface $transliteration

The transliteration helper.

protected CsrfTokenGenerator $tokenGenerator

The token generator.

Methods

__construct(TransliterationInterface $transliteration, CsrfTokenGenerator $token_generator)

Constructs a MachineNameController object.

static 
create(ContainerInterface $container)

Instantiates a new instance of this class.

JsonResponse
transliterate(Request $request)

Transliterates a string in given language. Various postprocessing possible.

Details

__construct(TransliterationInterface $transliteration, CsrfTokenGenerator $token_generator)

Constructs a MachineNameController object.

Parameters

TransliterationInterface $transliteration

The transliteration helper.

CsrfTokenGenerator $token_generator

The token generator.

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 transliterate(Request $request)

Transliterates a string in given language. Various postprocessing possible.

Parameters

Request $request

The input string and language for the transliteration. Optionally may contain the replace_pattern, replace, lowercase parameters.

Return Value

JsonResponse

The transliterated string.