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 
PagefileExtra::HTTPURL string No-cache version of httpUrl 
PagefileExtra::URL string No-cache version of url 
PagefileExtra::basename()
stringReturn just the basename (no path)
Can also be used as property: PagefileExtra::basename
 
PagefileExtra::create()
boolCreate the extra file
PagefileExtra::exists()
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 
PagefileExtra::filename()
stringReturn the full server disk path to the extra file, whether it exists or not
Can also be used as property: PagefileExtra::filename
 
PagefileExtra::filesize()
intReturn the file size in bytes
Can also be used as property: PagefileExtra::filesize
 
PagefileExtra::filesizeStr()
stringReturn human readable file size string
Can also be used as property: PagefileExtra::filesizeStr
 
PagefileExtra::get(string $key)
bool int mixed null stringGet property 
PagefileExtra::httpUrl()
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 
PagefileExtra::rename()
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 
PagefileExtra::setExtension($extension)
(nothing)Set extension for this extra 
PagefileExtra::setPagefile(Pagefile $pagefile)
(nothing)Set Pagefile instance this extra is connected to 
PagefileExtra::unlink()
boolUnlink/delete the extra file 
PagefileExtra::url()
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.160

Twitter updates

  • ProcessWire 3.0.161 adds support for selector operator stacking, enabling you automatically broaden searches in a single pages.find() call— More
    26 June 2020
  • ProcessWire 3.0.160 adds powerful new text-searching operators, bringing a new level of power to page-finding API calls, especially when it comes to search engine type queries. Post also includes a demo search engine where you can test it all out live— More
    19 June 2020
  • Preview of ProcessWire 3.0.160 with auto-enable of two-factor authentication, new version of TfaEmail and TfaTotp, and new selector operators coming next week. More
    12 June 2020

Latest news

  • ProcessWire Weekly #320
    In the 320th issue of ProcessWire Weekly we're going to check out the latest core updates (ProcessWire 3.0.161), a new third party module called Fieldtype Runtime only, an IndieWeb themed article from Francesco Schwarz, and more. Read on!
    Weekly.pw / 27 June 2020
  • Powerful new text-searching abilities in 3.0.160
    In ProcessWire 3.0.160 we’ve got some major upgrades and additions to our text-search abilities. This brings a whole new level of power to $pages->find() and similar API calls, especially when it comes to search engine type queries.
    Blog / 19 June 2020
  • Subscribe to weekly ProcessWire news

“I am currently managing a ProcessWire site with 2 million+ pages. It’s admirably fast, and much, much faster than any other CMS we tested.” —Nickie, Web developer