You are here

public function FileSystemBase::contents in Forena Reports 8

Return the contents of a file located in the report directory

Parameters

string $filename: filename and extension for report file.

Return value

Contents of file

Overrides FileInterface::contents

File

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

Class

FileSystemBase

Namespace

Drupal\forena\File

Code

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