mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 03:05:26 +02:00
Add @netcarver PR #226 to fix unintentional assignment in conditional, plus minor phpdoc update in InputfieldWrapper
Co-authored-by: netcarver
This commit is contained in:
@@ -478,7 +478,7 @@ class InputfieldWrapper extends Inputfield implements \Countable, \IteratorAggre
|
||||
* Note: string or array values for either argument require 3.0.196+.
|
||||
*
|
||||
* ~~~~~
|
||||
* // example 1: Get existing Inputfields and change order
|
||||
* // example 1: Get existing Inputfields and insert first_name before last_name
|
||||
* $firstName = $form->getByName('first_name');
|
||||
* $lastName = $form->getByName('last_name');
|
||||
* $form->insertBefore($firstName, $lastName);
|
||||
@@ -504,7 +504,20 @@ class InputfieldWrapper extends Inputfield implements \Countable, \IteratorAggre
|
||||
/**
|
||||
* Insert one Inputfield after one that’s already there.
|
||||
*
|
||||
* Note: string or array values for either argument require 3.0.196+.
|
||||
* Note: string or array values for either argument require 3.0.196+.
|
||||
*
|
||||
* ~~~~~
|
||||
* // example 1: Get existing Inputfields, insert last_name after first_name
|
||||
* $lastName = $form->getByName('last_name');
|
||||
* $firstName = $form->getByName('first_name');
|
||||
* $form->insertAfter($lastName, $firstName);
|
||||
*
|
||||
* // example 2: Same as above but use Inputfield names (3.0.196+)
|
||||
* $form->insertBefore('last_name', 'first_name');
|
||||
*
|
||||
* // example 3: Create new Inputfield and insert after first_name (3.0.196+)
|
||||
* $form->insertAfter([ 'type' => 'text', 'name' => 'last_name' ], 'first_name');
|
||||
* ~~~~~
|
||||
*
|
||||
* #pw-group-manipulation
|
||||
*
|
||||
|
Reference in New Issue
Block a user