public function FileBase::contents in Forena Reports 8
Same name and namespace in other branches
- 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
Namespace
Drupal\forena\FileCode
public function contents($filename) {
$path = $this
->path($filename);
if (file_exists($path)) {
return file_get_contents($path);
}
else {
return '';
}
}