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?        


PagefileExtra::HTTPURL string No-cache version of httpUrl 
PagefileExtra::URL string No-cache version of url 
stringReturn just the basename (no path)
Can also be used as property: PagefileExtra::basename
boolCreate the extra file
boolDoes the extra file currently exist?
Can also be used as property: PagefileExtra::exists
PagefileExtra::ext string Alias of extension 
PagefileExtra::extension string File extension 
stringReturn the full server disk path to the extra file, whether it exists or not
Can also be used as property: PagefileExtra::filename
intReturn the file size in bytes
Can also be used as property: PagefileExtra::filesize
stringReturn human readable file size string
Can also be used as property: PagefileExtra::filesizeStr
PagefileExtra::get(string $key)
bool int mixed null stringGet property 
stringReturn the HTTP URL to the extra file
Can also be used as property: PagefileExtra::httpUrl
PagefileExtra::pagefile Pagefile Pageimage Source Pageimage object 
PagefileExtra::pathname string Alias of filename 
boolRename the extra file to be consistent with Pagefile name 
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 
(nothing)Set extension for this extra 
PagefileExtra::setPagefile(Pagefile $pagefile)
(nothing)Set Pagefile instance this extra is connected to 
boolUnlink/delete the extra file 
stringReturn the URL to the extra file, creating it if it does not already exist
Can also be used as property: PagefileExtra::url
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.137

Twitter updates

  • We added WebP image support this year and many have been adopting it in existing projects. We look at a process used for migrating existing websites to WebP images— from preliminary considerations to implementation & testing, w/lots of tips & tricks too: More
    16 August 2019
  • Core version 3.0.137 on the dev branch adds the ability to hook multiple methods at once, in a single call. This post details how it works and provides a useful example of how you might put it to use in your development environment— More
    2 August 2019
  • ProcessWire 3.0.136 updates our CKEditor version and adds a new backtrace() method to the core Debug class— More
    26 July 2019

Latest news

  • ProcessWire Weekly #275
    In the 275th issue of ProcessWire Weekly we're going to walk you through the new features included in ProcessWire 3.0.138, cover some WebP related stuff, and highlight recent forum posts and online resources. Read on! / 17 August 2019
  • WebP images on an existing site
    In this post we’ll look at a process used for migrating an existing website to use WebP images. We’ll cover everything from preliminary considerations to implementation and testing, with lots of tips and tricks along the way.
    Blog / 16 August 2019
  • Subscribe to weekly ProcessWire news

“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