getFilename() public method

Returns the plain filename without path and suffix.
public getFilename ( ) : string
return string The plain filename without path and suffix
Example #1
0
 /**
  * Returns the path to an image which has been cached in a particular width, height and mode.
  *
  * @param UploadedFile $image  The image
  * @param integer      $width  The width
  * @param integer      $height The height
  * @param string       $mode   The mode
  *
  * @return string
  */
 public function getImageCacheFilename(UploadedFile $image, $width, $height, $mode)
 {
     $outputFile = $this->getImageCacheDirectory();
     $outputFile .= "/" . sha1($image->getFilename());
     $outputFile .= $width . "x" . $height . "_" . $mode . ".png";
     return $outputFile;
 }
Example #2
0
 /**
  * Returns the path to an image which has been cached in a particular width, height and mode.
  *
  * @param UploadedFile $image  The image
  * @param int          $width  The width
  * @param int          $height The height
  * @param string       $mode   The mode
  *
  * @return string
  */
 public function getImageCacheFilename(UploadedFile $image, $width, $height, $mode)
 {
     $outputFile = $this->getImageCacheDirectory();
     $outputFile .= '/' . sha1($image->getFilename());
     $outputFile .= $width . 'x' . $height . '_' . $mode . '.png';
     return $outputFile;
 }