set() public method

Essentially path supplied by user is resolved into real path (see {@link getRealPath}), all the other property getting methods should use that real path. Uploaded files are supported through {@link CUploadedFile} Yii class. Path aliases are supported through {@link getPathOfAlias} Yii method.
public set ( string $filepath, boolean $greedy = False ) : object
$filepath string Path to the file specified by user, if not set exception is raised
$greedy boolean If True file properties (such as 'Size', 'Owner', 'Permission', etc.) would be autoloaded
return object CFile instance for the specified filesystem object
Ejemplo n.º 1
0
 /**
  * Helper method. Return an appropriate CFile instance for a given filesystem object path.
  *
  * @static
  * @param string $filepath Path to the file.
  * @param bool $greedy If `True` file properties (such as 'Size', 'Owner', 'Permission', etc.) would be autoloaded
  * @return CFile
  */
 public static function get($filepath, $greedy = false)
 {
     if (self::$_obj === null) {
         self::$_obj = new self();
     }
     return self::$_obj->set($filepath, $greedy);
 }