You are here

public function TrackDaFilesController::table in Track da files 8

Builds a table which shows number of displays by file.

1 string reference to 'TrackDaFilesController::table'
track_da_files.routing.yml in ./track_da_files.routing.yml
track_da_files.routing.yml

File

src/Controller/TrackDaFilesController.php, line 39

Class

TrackDaFilesController
Class TrackDaFilesController.

Namespace

Drupal\track_da_files\Controller

Code

public function table($fid = NULL, $pid = NULL) {
  $output = '';
  $variables = '';
  if (!empty($fid) && !empty($pid)) {
    $build['table'] = $this
      ->table_build_file_report($fid, $pid);
    $file = File::load($fid);
    $filename = $file
      ->getFilename();
    $build['table']['#prefix'] = '<p>' . t('Datas for @filename', array(
      '@filename' => $filename,
    )) . '</p>';

    //$build['table_action_form'] = \Drupal::formBuilder()->getForm('\Drupal\track_da_files\Form\TrackDaFilesTableActionForm'/*, $extra*/);
  }
  else {
    $build['table'] = $this
      ->table_build();

    //$build['table_action_form'] = \Drupal::formBuilder()->getForm('\Drupal\track_da_files\Form\TrackDaFilesTableActionForm', 'buildForm');
  }
  return $build;
}