FieldtypeFile class

Field that stores one or more files

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

Show class?             Show args?        

Common

NameReturnSummary 
FieldtypeFile::allowFieldtypes array Allowed Fieldtype types for custom fields 
FieldtypeFile::cloneField(Field $field)
FieldReturn a cloned copy of $field
FieldtypeFile::defaultFileExtensions string 
FieldtypeFile::deleteField(Field $field)
boolDelete field
FieldtypeFile::deletePageField(Page $page, Field $field)
boolDelete field from page
FieldtypeFile::emptyPageField(Page $page, Field $field)
boolEmpty field from page
FieldtypeFile::exportValue(Page $page, Field $field, $value)
array float int stringExport value
FieldtypeFile::formatValue(Page $page, Field $field, Pagefiles $value)
Pagefiles PagefilePerform output formatting on the value delivered to the API
FieldtypeFile::formatValueString(Page $page, Field $field, $value)
string
FieldtypeFile::get($key)
mixedGet a property from this Fieldtype’s data 
FieldtypeFile::getBlankValue(Page $page, Field $field)
PagefilesGet blank value 
FieldtypeFile::getCompatibleFieldtypes(Field $field)
FieldtypesGet compatible Fieldtypes
FieldtypeFile::getConfigAdvancedInputfields(Field $field)
InputfieldWrapperField advanced config
FieldtypeFile::getConfigInputfields(Field $field)
InputfieldWrapperField config
FieldtypeFile::getDatabaseSchema(Field $field)
arrayGet database schema 
FieldtypeFile::getFieldSetups()
arrayGet setup options and setup functions for new fields
FieldtypeFile::getFilesPath(Page $page, Field $field)
stringGet path where files are (or would be) stored 
FieldtypeFile::getInputfield(Page $page, Field $field)
InputfieldGet the Inputfield module to handle input for this Fieldtype 
FieldtypeFile::getLoadQueryAutojoin(Field $field, DatabaseQuerySelect $query)
DatabaseQuerySelect nullDisable autojoin for files 
FieldtypeFile::getMatchQuery($query, string $table, string $subfield, string $operator, mixed $value)
DatabaseQuery DatabaseQuerySelectGet match query 
FieldtypeFile::getPagefile(Page $page, string $basename)
Pagefile nullGiven a Page and file basename, return the Pagefile object if file is found for Page 
FieldtypeFile::getPagefiles(Page $page, Field $field)
PagefilesGet Pagefiles 
FieldtypeFile::getSelectorInfo(Field $field)
arrayGet selector info
FieldtypeFile::getValidFileExtensions($field)
arrayCheck file extensions for given field and return array of validity information 
FieldtypeFile::loadPageField(Page $page, Field $field)
array null@param Page $page
FieldtypeFile::markupValue(Page $page, Field $field)
string MarkupFieldtypeRender a markup string of the value.
FieldtypeFile::renamedField(Field $field, string $prevName)
(nothing)Called after field renamed
FieldtypeFile::sanitizeValue(Page $page, Field $field, mixed $value)
PagefilesSanitize value 
FieldtypeFile::sleepValue(Page $page, Field $field, $value)
arrayGiven an 'awake' value, as set by wakeupValue, convert the value back to a basic type for storage in DB.
FieldtypeFile::wakeupValue(Page $page, Field $field, $value)
Pagefiles nullGiven a raw value (value as stored in DB), return the value as it would appear in a Page object

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #550
    In the 550th issue of ProcessWire Weekly we're going to check out the latest core updates, introduce a new third party module called PagefileMetadata, and more. Read on!
    Weekly.pw / 23 November 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his/her ways of doing things.” —Guy Verville, Spiria Digital Inc.