You are here

public function FileBase::contents in Forena Reports 8

Same name and namespace in other branches
  1. 7.5 src/File/FileBase.php \Drupal\forena\File\FileBase::contents()

Return the contents of a file located in the report directory

Parameters

string $filename : filename and extension for report file.

Return value

string Contents of file.

File

src/File/FileBaseOld.php, line 310
FileSystemBase.inc File toolbox for manipulating files contained tn the report directory.

Class

FileBase

Namespace

Drupal\forena\File

Code

public function contents($filename) {
  $path = $this
    ->path($filename);
  if (file_exists($path)) {
    return file_get_contents($path);
  }
  else {
    return '';
  }
}