PagefileExtra class

Extra extension for Pagefile or Pageimage objects

Properties

The following properties affect the behavior of the URL-related methods

Hookable methods


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?       Only hookable?    

Common

NameReturnSummary 
PagefileExtra::basename()
string

Return just the basename (no path)


Can also be used as property: PagefileExtra::basename
 
PagefileExtra::create()
bool

Create the extra file

PagefileExtra::exists()
bool

Does the extra file currently exist?


Can also be used as property: PagefileExtra::exists
 
PagefileExtra::filename()
string

Return the full server disk path to the extra file, whether it exists or not


Can also be used as property: PagefileExtra::filename
 
PagefileExtra::filesize()
int

Return the file size in bytes


Can also be used as property: PagefileExtra::filesize
 
PagefileExtra::filesizeStr()
string

Return human readable file size string


Can also be used as property: PagefileExtra::filesizeStr
 
PagefileExtra::get(string $key)
bool int mixed null string

Get property

 
PagefileExtra::httpUrl()
string

Return the HTTP URL to the extra file


Can also be used as property: PagefileExtra::httpUrl
 
PagefileExtra::noCacheURL()
string

Get cache busted URL

PagefileExtra::rename()
bool

Rename the extra file to be consistent with Pagefile name

 
PagefileExtra::setExtension($extension)
None

Set extension for this extra

 
PagefileExtra::setPagefile(Pagefile $pagefile)
None

Set Pagefile instance this extra is connected to

 
PagefileExtra::unlink()
bool

Unlink/delete the extra file

 
PagefileExtra::url()
string

Return the URL to the extra file, creating it if it does not already exist


Can also be used as property: PagefileExtra::url
 

Properties

NameReturnSummary 
PagefileExtra::HTTPURL string No-cache version of httpUrl 
PagefileExtra::URL string No-cache version of url 
PagefileExtra::ext string Alias of extension 
PagefileExtra::extension string File extension 
PagefileExtra::pagefile Pagefile Pageimage Source Pageimage object 
PagefileExtra::pathname string Alias of filename 
PagefileExtra::savings int Bytes saved by this extra 
PagefileExtra::savingsPct string Percent savings by this extra 
PagefileExtra::savingsStr string Human readable savings by this extra 
PagefileExtra::useSrcExt bool Use longer filenames that also include the Pagefile’s extension?
DEFAULT: false
 
PagefileExtra::useSrcUrlOnFail bool Use source Pagefile URL if extra image does not exist and cannot be created?
DEFAULT: false
 
PagefileExtra::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.253