TYPO3 CMS  TYPO3_6-2
SizeViewHelper.php
Go to the documentation of this file.
1 <?php
3 
18 
32 
40  public function render($format = TRUE) {
41  $absolutePathToFile = $this->renderChildren();
42  if (!is_file($absolutePathToFile)) {
43  throw new \TYPO3\CMS\Install\ViewHelpers\Exception(
44  'File not found',
45  1369563246
46  );
47  }
48  $size = filesize($absolutePathToFile);
49  if ($format) {
50  $size = GeneralUtility::formatSize($size);
51  }
52  return $size;
53  }
54 }
static formatSize($sizeInBytes, $labels='')