yupe\helpers\YFile::rmFile PHP Method

rmFile() public static method

Since: 0.8
public static rmFile ( $file ) : boolean
$file
return boolean
    public static function rmFile($file)
    {
        if (!file_exists($file)) {
            return true;
        }
        return @unlink($file);
    }

Usage Example

 /**
  * @return null|string
  */
 public function getFilePath()
 {
     if (!$this->attribute->isType(Attribute::TYPE_FILE)) {
         return null;
     }
     $file = Yii::app()->getBasePath() . '/' . Yii::app()->getModule('yupe')->uploadPath . '/' . Yii::app()->getModule('store')->uploadPath . '/product/' . $this->value();
     return \yupe\helpers\YFile::rmFile($file);
 }
All Usage Examples Of yupe\helpers\YFile::rmFile