| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
FileSystem |
JFolder |
move |
move() |
Never | Work in Progress |
Moves a folder. This function uses FTP if enabled, otherwise, it will use the built in PHP functions. This function returns true on success, false otherwise.
mixed move ( $src, $dest, $path )
| $src | string | is a string containing the path to the source folder. |
| $dest | string | is a string containing the path to the destination folder. |
| $path | string | is an optional string containing a base path to prefix to the file names. |
In this example a folder called ‘myfolder/oldsubfolder’ in the Joomla! root folder is moved (together with its contents) to ‘myfolder/newsubfolder’.
Example
jimport( 'joomla.filesystem.folder' ); global $mainframe; if (JFolder::move( 'oldsubfolder', 'newsubfolder', $mainframe->getCfg( 'absolute_path' ) . '/myfolder/' )) { echo "Folder moved!"; } else { echo "Could not move folder!"; }
might produce:
Result
Folder moved!