You are here

public function YamlFormController::javascript in YAML Form 8

Returns a form's JavaScript.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The current request.

\Drupal\yamlform\YamlFormInterface $yamlform: The form.

Return value

\Symfony\Component\HttpFoundation\Response The response object.

1 string reference to 'YamlFormController::javascript'
yamlform.routing.yml in ./yamlform.routing.yml
yamlform.routing.yml

File

src/Controller/YamlFormController.php, line 87

Class

YamlFormController
Provides route responses for form.

Namespace

Drupal\yamlform\Controller

Code

public function javascript(Request $request, YamlFormInterface $yamlform) {
  return new Response($yamlform
    ->getJavaScript(), 200, [
    'Content-Type' => 'text/javascript',
  ]);
}