F::exists PHP Method

exists() public static method

Checks if a file exists
public static exists ( string $file ) : boolean
$file string
return boolean
    public static function exists($file)
    {
        return file_exists($file);
    }

Usage Example

 /**
  * Sanitize "theme" option.
  *
  * @since 1.0.0
  *
  * @param string
  * @return string
  */
 protected function sanitizeThemeOption($value)
 {
     // Check for safe theme names
     if (V::match($value, '/^[a-z0-9_-]+$/i')) {
         // Check if theme file exists
         $path = self::ACE_ASSETS_PATH . 'theme-' . $value . '.js';
         if (F::exists($path)) {
             return $value;
         }
     }
     return 'kirby';
 }