PagefilesManager::emptyPath() method

Empty out the published files (delete all of them)

Usage

// basic usage
$bool = $pagefilesManager->emptyPath();

// usage with all arguments
$bool = $pagefilesManager->emptyPath(bool $rmdir = false, bool $recursive = true);

Arguments

NameType(s)Description
rmdir (optional)bool

Remove the directory too? (default=false)

recursive (optional)bool

Recursively do the same for subdirectories? (default=true)

Return value

bool

True on success, false on error (since 3.0.17, previous versions had no return value).


PagefilesManager methods and properties

API reference based on ProcessWire core version 3.0.244

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits