You are here

public function TFTController::ajaxGetFolder in Taxonomy File Tree 3.x

Same name and namespace in other branches
  1. 8 src/Controller/TFTController.php \Drupal\tft\Controller\TFTController::ajaxGetFolder()

Returns folder.

Return value

\Symfony\Component\HttpFoundation\JsonResponse Response.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 string reference to 'TFTController::ajaxGetFolder'
tft.routing.yml in ./tft.routing.yml
tft.routing.yml

File

src/Controller/TFTController.php, line 631

Class

TFTController
Class TFTController.

Namespace

Drupal\tft\Controller

Code

public function ajaxGetFolder() {
  $tid = $_GET['tid'];
  $gid = _tft_get_group_gid($tid);
  $renderer = \Drupal::service('renderer');
  $data = $this
    ->content_table($tid, $gid);
  return new JsonResponse([
    'data' => $renderer
      ->renderRoot($data),
    'parent' => _tft_get_parent_tid($tid, $gid),
    'ops_links' => '',
  ]);
}