InputfieldRepeater class

Maintains a collection of fields that are repeated for any number of times.

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

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
InputfieldRepeater::copyPasteCookieName()
string

Get the copy/paste cookie name

 
InputfieldRepeater::getConfigInputfields()
InputfieldWrapper

@return InputfieldWrapper

InputfieldRepeater::getWrappers()
array InputfieldWrapper

Get the repeater wrappers (InputfieldWrappers) indexed by repeater page ID

 
InputfieldRepeater::isEmpty()
bool

Returns whether any values are present

 
InputfieldRepeater::numPublished()
int

Return quantity of published items

 
InputfieldRepeater::numRequiredEmpty()
int

Get number of required but empty Inputfields (across all repeater items)

 
InputfieldRepeater::processInput(WireInputData $input)
$this

Process the input from a submitted repeaters field

InputfieldRepeater::render()
string

Render the repeater items

InputfieldRepeater::renderAjaxNewItem()
string

Render a new item for ajax after 'add new' link clicked

 
InputfieldRepeater::renderReady()
bool

Called before render() or renderValue() method by InputfieldWrapper, before Inputfield-specific CSS/JS files added

 
InputfieldRepeater::renderRepeaterLabel(string $label, int $cnt, Page $page)
string

Render the repeater label

InputfieldRepeater::renderValue()
string

Render value (no inputs)

InputfieldRepeater::set(string $key, mixed $value)
Inputfield InputfieldRepeater

Override the default set() to capture the required $page variable that the repeaters field lives on.

 
InputfieldRepeater::setAttribute($key, $value)
InputfieldRepeater Inputfield

Set attribute

 

Properties

NameReturnSummary 
InputfieldRepeater::accordionMode bool int When enabled, only one repeater item will be open at a time.
DEFAULT: false
 
InputfieldRepeater::familyFriendly bool int This setting makes the admin page editor treat item depth as a parent/child relationship when it comes to sorting/moving items.
DEFAULT: false
 
InputfieldRepeater::familyToggle bool int When enabled, opening (or closing) a repeater item also opens (or closes) the next items that are visually children of it, when combined with familyFriendly mode.
DEFAULT: false
 
InputfieldRepeater::loudControls bool int Always show controls regardless of hover?
DEFAULT: false
 
InputfieldRepeater::noScroll bool int Do not scroll to newly added items?
DEFAULT: false
 
InputfieldRepeater::repeaterDepth int Maximum allowed depth for repeater items or 0 to disable
DEFAULT: 0
 
InputfieldRepeater::repeaterMaxItems int Maximum repeater items or 0 for no max
DEFAULT: 0
 
InputfieldRepeater::repeaterMinItems int Minimum repeater items or 0 for no min
DEFAULT: 0
 
InputfieldRepeater::singleMode bool int Limit repeater to a single item, primarily for the extending FieldsetPage module.
DEFAULT: false
 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.252