Skip to content

Instantly share code, notes, and snippets.

@signalpoint
signalpoint / customController.php
Created July 23, 2015 21:52
Drupal 8 Output JSON
<?php
// ...
use Symfony\Component\HttpFoundation\Response;
// Then later on (inside your controller's class), you have a function used
// for the route_name (on a hook_menu() item in your .module file), this
// function can return a JSON response...