PagefileExtra class

Located in file /wire/core/PagefileExtra.php

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the PagefileExtra class also inherits all the methods and properties of: WireData and Wire.

Show class?             Show args?        

Common

NameReturnSummary 
HTTPURL string No-cache version of httpUrl 
URL string No-cache version of url 
basename()
stringReturn just the basename (no path)
Can also be used as property: basename
 
create()
boolCreate the extra file
exists()
boolDoes the extra file currently exist?
Can also be used as property: exists
 
ext string Alias of extension 
extension string File extension 
filename()
stringReturn the full server disk path to the extra file, whether it exists or not
Can also be used as property: filename
 
filesize()
intReturn the file size in bytes
Can also be used as property: filesize
 
filesizeStr()
stringReturn human readable file size string
Can also be used as property: filesizeStr
 
get(string $key)
bool int mixed null stringGet property 
httpUrl()
stringReturn the HTTP URL to the extra file
Can also be used as property: httpUrl
 
noCacheURL()
stringGet cache busted URL
pagefile Pagefile Pageimage Source Pageimage object 
pathname string Alias of filename 
rename()
boolRename the extra file to be consistent with Pagefile name 
savings int Bytes saved by this extra 
savingsPct string Percent savings by this extra 
savingsStr string Human readable savings by this extra 
setExtension($extension)
(nothing)Set extension for this extra 
setPagefile(Pagefile $pagefile)
(nothing)Set Pagefile instance this extra is connected to 
unlink()
boolUnlink/delete the extra file 
url()
stringReturn the URL to the extra file, creating it if it does not already exist
Can also be used as property: url
 
useSrcExt bool Use longer filenames that also include the Pagefile’s extension? (default=false) 
useSrcUrlOnFail bool Use source Pagefile URL if extra image does not exist and cannot be created? (default=false) 
useSrcUrlOnSize bool Use source Pagefile URL if extra file is larger than source file? (default=false) 

Additional methods and properties

In addition to the methods and properties above, PagefileExtra also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.244

“We were really happy to build our new portfolio website on ProcessWire! We wanted something that gave us plenty of control on the back-end, without any bloat on the front end - just a nice, easy to access API for all our content that left us free to design and build however we liked.” —Castus, web design agency in Sheffield, UK